Documentation ¶
Index ¶
- Constants
- type CliApp
- func (app *CliApp) Errorf(format string, info ...interface{})
- func (app *CliApp) Exitf(code int, format string, info ...interface{})
- func (app *CliApp) Infof(format string, info ...interface{})
- func (app *CliApp) Run(args ...string) (err error)
- func (app *CliApp) Successf(format string, info ...interface{})
- func (app *CliApp) Warningf(format string, info ...interface{})
- type Command
- func (cmd *Command) AddCommand(name string, desc string, handler Handler, opts ...*Option) *Command
- func (cmd *Command) App() *CliApp
- func (cmd *Command) OptVal(name string) (val reflect.Value)
- func (cmd *Command) OptValE(name string) (val reflect.Value, err error)
- func (cmd *Command) ParentCommand() *Command
- func (cmd *Command) ShowHelp()
- func (cmd *Command) SubCommand(name string) *Command
- type Handler
- type Option
Constants ¶
View Source
const CODE_ERROR_COMMON = 100
View Source
const CODE_SUCCESS = 0
成功执行
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CliApp ¶
type CliApp struct {
*Command // the self root command
}
app
func NewCliWholeApp ¶ added in v0.0.2
实例化一个描述为desc,根参数为opts,且没有子命令的cli app
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
command
func (*Command) AddCommand ¶ added in v0.0.2
创建一个command,handler里options为解析后的参数(-开头)
func (*Command) ParentCommand ¶ added in v0.0.2
获取父command
func (*Command) SubCommand ¶ added in v0.0.2
获取子command
Click to show internal directories.
Click to hide internal directories.