Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Argument ¶
type Argument interface { Parameter // Default 参数默认值 Default() any // Target 绑定值 Target() any // Text 默认显示文本 Text() string // Required 是否是必填项 Required() bool // Flag 解析出真正使用的参数 Flag() Flag }
Argument 参数
type Arguments ¶
type Arguments []Argument
Arguments 参数列表
type Command ¶
type Command interface { Parameter Stopper Lifecycle // Run 执行命令 Run(ctx context.Context) error // Arguments 参数列表 Arguments() Arguments // Subcommands 子命令列表 Subcommands() Commands // Description 描述文字 Description() string // Category 分类 Category() string }
Command 描述一个可以被执行的命令
type Flag ¶
type Flag interface { fmt.Stringer // Apply 解析参数 Apply(set *flag.FlagSet) error // Names 别名列表 Names() []string // IsSet 是否可设置 IsSet() bool }
Flag 描述一个可以被解析的参数或者选项
Click to show internal directories.
Click to hide internal directories.