Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comandante ¶
type Comandante struct {
// contains filtered or unexported fields
}
func (*Comandante) IncludeHelp ¶
func (c *Comandante) IncludeHelp()
IncludeHelp adds the built in help command.
func (*Comandante) RegisterCommand ¶
func (c *Comandante) RegisterCommand(cmd *Command) error
RegisterCommand tells Comandante about a command so that it can be used.
func (*Comandante) Run ¶
func (c *Comandante) Run() error
Run finds a command based on the command line argument and invokes the command in the case that one is found.
type Command ¶
type Command struct { // Name is used for invoking the command. If Name is "sayhello" the command is // invoked with: your-binary sayhello Name string // ShortDescription is a one line description of the command that is displayed in // the default list of commands ShortDescription string // Documentation is a longer form of help text that is displayed when help // information is queried about a specific command. Documentation string // Action is the function called when the command is invoked Action actionFunc // FlagInit is the function called to handle delaing with flags sent to the command FlagInit flagInitFunc // FlagPostParse is the function called after the flagset has been parsed FlagPostParse flagPostParseFunc // contains filtered or unexported fields }
Command details a command that can be run from the command line
func NewCommand ¶
NewCommand creates a new command with a name, a short description and an action that runs when the command is invoked.
type PrintableCommandsByName ¶
type PrintableCommandsByName struct {
// contains filtered or unexported fields
}
func (PrintableCommandsByName) Less ¶
func (s PrintableCommandsByName) Less(i, j int) bool
Click to show internal directories.
Click to hide internal directories.