cli

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagErrorFunc

func FlagErrorFunc(cmd *cobra.Command, err error) error

func NoArgs

func NoArgs(cmd *cobra.Command, args []string) error

func RequiresMinArgs

func RequiresMinArgs(min int) cobra.PositionalArgs

func SetupRootCommand

func SetupRootCommand(rootCmd *cobra.Command) *cliflags.ClientOptions

func VisitAll

func VisitAll(root *cobra.Command, fn func(*cobra.Command))

Types

type Errors

type Errors []error

func (Errors) Error

func (errList Errors) Error() string

type StatusError

type StatusError struct {
	Status     string
	StatusCode int
}

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中

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL