Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse will populate the "receiver" object with the parsed values of the given "args". If the parser encounters a non-flag value, it will stop parsing and return the remainer of arguments. Parse will return an error in the case that the flags cannot be parsed, or a required flag is missing. The receiver is expected to be a pointer.
func PrintUsage ¶
PrintUsage will return a string representation of the options provided by a Command flag set.
Types ¶
type Command ¶
Command defines the interface for a command object type. For an object to be executable as a command, you will need to implement these methods.
type CommandSet ¶
CommandSet is a structural collection of executable commands referenced by a name. Use this object to translate the name of the command given at the commandline to an executable object to be invoked.
func (CommandSet) Execute ¶
func (cs CommandSet) Execute(command string, args []string) error
Execute will invoke the Execute method of the Command that matches the name provided as "command", passing "args". Execute will return an error in the case that the command cannot be found by the given name.