Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd interface {
//Init will construct command line parser with options
Init(options ...Option) error
//Parse will parse so.args
Parse([]string) error
//GetString will get string flag from cli context
GetString(string) string
//GetBool will get bool flag from cli context
GetBool(string) bool
//GetNumber will get number flag from cli context
GetNumber(string) int
}
Cmd is box's command line parser
type CommandCfg ¶
CommandCfg is the config of command
type FlagCfg ¶
type FlagCfg struct {
*BaseCfg
//Default value
Default string
//Dest is pointer of value
Dest interface{}
}
FlagCfg is the config of parameter
type Option ¶
type Option func(options *Options)
func WithCommand ¶
func WithCommand(command *CommandCfg) Option
func WithStringFlag ¶
WithStringFlag will create string flag
Click to show internal directories.
Click to hide internal directories.