interactive

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlag added in v0.0.3

func AddFlag(flags *pflag.FlagSet)

AddFlag adds the interactive flag to the given set of command line flags.

func Enabled added in v0.0.3

func Enabled() bool

Enabled retursn a boolean flag that indicates if the interactive mode is enabled.

func GetBool added in v0.0.3

func GetBool(input Input) (a bool, err error)

Asks for true/false value in the command line

func GetIPNet added in v0.0.3

func GetIPNet(input Input) (a net.IPNet, err error)

Asks for CIDR value in the command line

func GetInput

func GetInput(q string) (a string, err error)

Gets user input from the command line

func GetInt added in v0.0.3

func GetInt(input Input) (a int, err error)

Gets int number input from the command line

func GetOption added in v0.0.3

func GetOption(input Input) (a string, err error)

Asks for option selection in the command line

func GetPassword

func GetPassword(input Input) (a string, err error)

Gets password input from the command line

func GetString added in v0.0.3

func GetString(input Input) (a string, err error)

Gets string input from the command line

func PrintHelp added in v0.0.3

func PrintHelp(help Help) error

Types

type Help added in v0.0.3

type Help struct {
	Message string
	Steps   []string
}

type Input added in v0.0.3

type Input struct {
	Question string
	Help     string
	Options  []string
	Default  interface{}
	Required bool
}

Jump to

Keyboard shortcuts

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