Documentation
¶
Index ¶
- func FlagErrorFunc(cmd *cobra.Command, err error) error
- func NoArgs(cmd *cobra.Command, args []string) error
- func RequiresMinArgs(min int) cobra.PositionalArgs
- func SetupRootCommand(rootCmd *cobra.Command) *cliflags.ClientOptions
- func VisitAll(root *cobra.Command, fn func(*cobra.Command))
- type Errors
- type StatusError
- type TopLevelCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequiresMinArgs ¶
func RequiresMinArgs(min int) cobra.PositionalArgs
func SetupRootCommand ¶
func SetupRootCommand(rootCmd *cobra.Command) *cliflags.ClientOptions
Types ¶
type StatusError ¶
StatusError 打印一个不成功的退出
func (StatusError) Error ¶
func (e StatusError) Error() string
type TopLevelCommand ¶
type TopLevelCommand struct {
// contains filtered or unexported fields
}
func NewTopLevelCommand ¶
func NewTopLevelCommand(cmd *cobra.Command, dockerCli *cmd.SudockerCli, opts *cliflags.ClientOptions, flags *pflag.FlagSet) *TopLevelCommand
NewTopLevelCommand 返回一个 new TopLevelCommand 对象
func (*TopLevelCommand) HandleGlobalFlags ¶
func (tcmd *TopLevelCommand) HandleGlobalFlags() (*cobra.Command, []string, error)
HandleGlobalFlags 解析全局flag eg. sudocker --debug true run xxx
func (*TopLevelCommand) Initialize ¶
func (tcmd *TopLevelCommand) Initialize(ops ...cmd.CLIOption) error
通过解析全局option来初始化sudocker 客户端
func (*TopLevelCommand) SetArgs ¶
func (tcmd *TopLevelCommand) SetArgs(args []string)
SetArgs 通过设置参数用来调用命令
func (*TopLevelCommand) SetFlag ¶
func (tcmd *TopLevelCommand) SetFlag(name, value string)
SetFlag 设置top command的flag到flagset中
Click to show internal directories.
Click to hide internal directories.