cmd

package
v0.0.0-...-d7d6a54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute starts the root command.

Types

type CliPrompt

type CliPrompt struct {
}

CliPrompt represents a cli user input interface.

func (*CliPrompt) Input

func (c *CliPrompt) Input(label string) (string, error)

Input allows to ask the user for a single line input.

func (*CliPrompt) MultiSelect

func (c *CliPrompt) MultiSelect(label string, options []string) ([]int, error)

MultiSelect allows the user to select multiple options between the available ones. Will return a slice containig the indexes of the selected options.

func (*CliPrompt) Select

func (c *CliPrompt) Select(label string, options []string) (int, error)

Select allows the user to select a single option between the available ones. Will return the index of the selected option.

type Prompt

type Prompt interface {
	Input(label string) (string, error)
	Select(label string, options []string) (int, error)
	MultiSelect(label string, options []string) ([]int, error)
}

Prompt represents an user input interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL