Documentation ¶
Index ¶
- Constants
- Variables
- func ParseInt(s string) (val int, err error)
- type Arg
- type CmdLine
- type Command
- type Env
- type Flag
- type Flags
- func (fs *Flags) Arg(n int) string
- func (fs *Flags) Args() []string
- func (fs *Flags) Bool(f Flag) *bool
- func (fs *Flags) Byte(f Flag) *byte
- func (fs *Flags) Bytes(f Flag) *[]byte
- func (fs *Flags) Enum(f Flag, vals ...string) *string
- func (fs *Flags) Example(cmdline, desc string)
- func (fs *Flags) Int(f Flag) *int
- func (fs *Flags) Parse() error
- func (fs *Flags) SetHelpParameters(s string)
- func (fs *Flags) String(f Flag) *string
- func (fs *Flags) Uint16(f Flag) *uint16
- func (fs *Flags) UsageError(format string, a ...interface{}) error
- type Prompt
- type RunArgs
- type Shell
- func (sh *Shell) AddCommand(name, desc string, exec func(RunArgs) error)
- func (sh *Shell) AddCommands(cmds ...Command)
- func (sh *Shell) Get(k string) interface{}
- func (sh *Shell) NewSubShell(name, desc string, init func(RunArgs) error) *Shell
- func (sh *Shell) Run() error
- func (sh *Shell) Set(k string, v interface{})
- func (sh *Shell) SetNoExit(v bool)
- type Ticker
Constants ¶
View Source
const Interrupt byte = 0x03
Variables ¶
View Source
var ErrInterrupt = errors.New("interrupted")
Functions ¶
Types ¶
type CmdLine ¶
CmdLine represents a command line invocation.
func ParseCmdLine ¶
ParseCmdLine parses a command line string.
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env manages environment variables.
type Flags ¶
type Flags struct {
// contains filtered or unexported fields
}
func (*Flags) SetHelpParameters ¶
SetHelpParameters sets the parameters for the usage output.
func (*Flags) UsageError ¶
type RunArgs ¶
func (*RunArgs) WaitForInterrupt ¶
WaitForInterrupt will return true until CTRL+C is pressed.
type Shell ¶
type Shell struct {
// contains filtered or unexported fields
}
func (*Shell) AddCommands ¶
func (*Shell) NewSubShell ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.