Documentation ¶
Overview ¶
Package cmdapp implements a command line application that host a set of commands as in the go tool or git.
Index ¶
Constants ¶
View Source
const ( ExitOk = iota // success ExitErr // any processing error ExitArgs // invalid arguments ExitIn // error while reading input ExitOut // error while writing output )
Common exit codes.
Variables ¶
View Source
var Commands []*Command
Commands is the list of available commands and help topics. The order in the list is used for help output.
View Source
var Short string
Short is a short description of the application.
Functions ¶
Types ¶
type Command ¶
type Command struct { // Run runs the command. // The argument list is the set of arguments unparsed by flag // package. Run func(c *Command, args []string) // UsageLine is the usage message. // The first word in the line is taken to be the command name. UsageLine string // Short is a short description of the command. Short string // Long is the long message shown in 'help <this-command>' output. Long string // Flag is the set of flags specific to this command. Flag flag.FlagSet }
A Command is an implementation of a hosted command.
Click to show internal directories.
Click to hide internal directories.