Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CommandRunner ¶
type CommandRunner interface { // Name gets the name of the Command Name() string // Usage gets the usage string for the Command Usage() string // Run will run the command and return any errors Run() error }
CommandRunner is an interface for commands, allowing commands to implement the minimum set of requirements to observe and run the command from above. It is used as a return type to allow passing a usable command to the caller after parsing and creating the command implementation
func ParseCLI ¶
func ParseCLI(env environment.Environment) (CommandRunner, error)
ParseCLI parses for a subcommand as the first argument to the calling binary, and initializes the command (if it exists). It also provides the default usage statement.
It does not support flags of its own, each subcommand is responsible for parsing their flags.
Click to show internal directories.
Click to hide internal directories.