cli_helper

package
v0.0.0-...-6b87df2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(name string, help string, synopsis string, run RunArgs) error

func GetCPui

func GetCPui() *cli.ColoredPrefixedUi

func GetInput

func GetInput(name string) string

func GetInputSecret

func GetInputSecret(name string) string

func Init

func Init(app, version string)

func Run

func Run()

func RunOnce

func RunOnce(argv []string) (int, error)

func SwitchPrefix

func SwitchPrefix(prefix string)

Types

type Function

type Function struct {
	// Help should return long-form help text that includes the command-line
	// usage, a brief few sentences explaining the function of the command,
	// and the complete list of flags the command accepts.
	Help_ string

	// Run should run the actual command with the given CLI instance and
	// command-line arguments. It should return the exit status when it is
	// finished.
	//
	// There are a handful of special exit codes this can return documented
	// above that change behavior.
	RunArgs_ RunArgs

	// Synopsis should return a one-line, short synopsis of the command.
	// This should be less than 50 characters ideally.
	Synopsis_ string
}

func (*Function) Help

func (f *Function) Help() string

func (*Function) Run

func (f *Function) Run(args []string) int

func (*Function) Synopsis

func (f *Function) Synopsis() string

type RunArgs

type RunArgs func(args []string) int

Jump to

Keyboard shortcuts

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