Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct { Prog string Description string Stderr io.Writer Usage func() // contains filtered or unexported fields }
Cli represents a command line interface.
func (*Cli) CmdHelp ¶
CmdHelp displays information on a command.
If more than one command is specified, information is only shown for the first command.
Usage: cli help COMMAND or cli COMMAND --help
func (*Cli) Subcmd ¶
func (cli *Cli) Subcmd(name string, synopses []string, description string, exitOnError bool) *flag.FlagSet
Subcmd is a subcommand of the main command. A subcommand represents an action that can be performed from the command line.
To see all available subcommands, run "cli --help".
type Handler ¶
Handler holds the different commands Cli will call. It should have methods with names starting with `Cmd` like:
func (h myHandler) CmdFoo(args ...string) error
type Initializer ¶
type Initializer interface {
Initialize() error
}
Initializer can be optionally implemented by a Handler to initialize before each call to one of its commands.
Click to show internal directories.
Click to hide internal directories.