Documentation ¶
Overview ¶
Package argparse keeps parsing command-line arguments simple!
Index ¶
- type Args
- type Program
- func (prog *Program) Command(short, long, description string, handler func(Args)) *Program
- func (prog *Program) Description(name, description string) *Program
- func (prog *Program) Epilog(epilog string) *Program
- func (prog *Program) Parse() *Program
- func (prog *Program) ShowHelp() *Program
- func (prog *Program) ShowVersion() *Program
- func (prog *Program) Version(version string) *Program
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Args ¶
Args is a struct passed to all command functions. It has the ArgMap from minimist embedded.
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is the terminal interface object
Example ¶
prog := New() prog.Description("example", "description") prog.Version("0.0.0") prog.Epilog("epilog") prog.Command("s", "start", "starts application", func(a Args) {}) prog.ShowHelp()
Output: example: description Available Commands: H, help show help information V, version show version information s, start starts application epilog
func (*Program) Description ¶
Description adds a name and description of the program
func (*Program) ShowVersion ¶
ShowVersion shows version information to users
Click to show internal directories.
Click to hide internal directories.