Documentation
¶
Index ¶
- Variables
- func Execute(args ...string) error
- func Register(commands ...*Command)
- type Command
- func (c *Command) AddOption(options ...Option) *Command
- func (c *Command) Execute() error
- func (c *Command) FlagSet() *flag.FlagSet
- func (c *Command) GetArg(index int) string
- func (c *Command) GetArgs() []string
- func (c *Command) GetOptionValue(name string) typex.Value
- func (c *Command) Join(command *Command) *Command
- func (c *Command) Name() string
- func (c *Command) NeedHelp() bool
- func (c *Command) ParseArgs() error
- func (c *Command) PrintOptions()
- func (c *Command) PrintSubs()
- func (c *Command) Register()
- func (c *Command) SetExecutor(executor func() error) *Command
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var Main = NewCommand("main", "根命令")
Main 根命令
Functions ¶
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func (*Command) GetOptionValue ¶
GetOptionValue 获取参数值
func (*Command) SetExecutor ¶
SetExecutor 设置执行器
Click to show internal directories.
Click to hide internal directories.