Documentation ¶
Overview ¶
Package cli is a library to help creating command line tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { Definition() string // usually it's the output for --help Exec(args []string) error }
To add a module, implement this interface. Definition is the command definition. Exec is the behaviour that you want to implement as a command
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is the shared structure of commands and sub-commands.
func NewCLI ¶
func NewCLI() *Module
NewCLI returns a root Module that you can add commands and another modules (sub-commands).
func (*Module) AddCommand ¶
AddCommand adds a new command this module.
func (*Module) AddSubCommand ¶
AddSubCommand adds a new sub-command this module.
func (*Module) Definition ¶
Click to show internal directories.
Click to hide internal directories.