Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CliOptions ¶
type CliOptions interface { // AddFlags adds flags to the specified FlagSet object. // AddFlags(fs *pflag.FlagSet) Flags() (fss cliflag.NamedFlagSets) //返回多个 pflag.FlagSet 就是记录 Validate() []error // 验证基本参数是否正确 }
命令行接口
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command 为 root 的子命令
type CompleteableOptions ¶
type CompleteableOptions interface {
Complete() error
}
CompleteableOptions 抽象了可以完成的选项。
type Option ¶
type Option func(app *App)
选项模式给动态给 APP 赋值
func WithDefaultValidArgs ¶
func WithDefaultValidArgs() Option
构建 验证函数 并且若 func(cmd *cobra.Command, args []string) len(args) >0 则 return 非必须
type PrintableOptions ¶
type PrintableOptions interface {
String() string
}
PrintableOptions 可打印的摘要选项。
Click to show internal directories.
Click to hide internal directories.