Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Help = CMD{ Name: "help", Alias: "?", Short: "Get help with a specific subcommand", Args: &HelpArgs{}, Run: HelpRun, }
Help fulfills the "help" subcommand
Functions ¶
Types ¶
type CMD ¶
type CMD struct {
Name string
Alias string
Short string
Args interface{}
Run func(r *RootCMD, c *CMD)
}
CMD is a type for all commands
type HelpArgs ¶
type HelpArgs struct {
Subcommand string `desc:"Command to get help for"`
}
HelpArgs contains the arguments for the "help" subcommand
type RootCMD ¶
type RootCMD struct {
Name string
Short string
Subcommands map[string]*CMD
Aliases map[string]string
Flags interface{}
}
RootCMD is the main command that runs everything
func (*RootCMD) RegisterCMD ¶
RegisterCMD add a sub-command to this program
Click to show internal directories.
Click to hide internal directories.