{"modulePath":"github.com/telecomposeio/docker-cli","version":"v0.0.0-20230330191823-de0d30ff24fa","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cli\n\n## Functions\n\n```go\nfunc DisableFlagsInUseLine(cmd *cobra.Command)\n```\nDisableFlagsInUseLine sets the DisableFlagsInUseLine flag on all commands within the tree rooted at cmd.\n\n```go\nfunc ExactArgs(number int) cobra.PositionalArgs\n```\nExactArgs returns an error if there is not the exact number of args\n\n```go\nfunc FlagErrorFunc(cmd *cobra.Command, err error) error\n```\nFlagErrorFunc prints an error message which matches the format of the docker/cli/cli error messages\n\n```go\nfunc HasCompletionArg(args []string) bool\n```\nHasCompletionArg returns true if a cobra completion arg request is found.\n\n```go\nfunc NoArgs(cmd *cobra.Command, args []string) error\n```\nNoArgs validates args and returns an error if there are any args\n\n```go\nfunc RequiresMaxArgs(max int) cobra.PositionalArgs\n```\nRequiresMaxArgs returns an error if there is not at most max args\n\n```go\nfunc RequiresMinArgs(min int) cobra.PositionalArgs\n```\nRequiresMinArgs returns an error if there is not at least min args\n\n```go\nfunc RequiresRangeArgs(min int, max int) cobra.PositionalArgs\n```\nRequiresRangeArgs returns an error if there is not at least min args and at most max args\n\n```go\nfunc SetupPluginRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *pflag.FlagSet)\n```\nSetupPluginRootCommand sets default usage, help and error handling for a plugin root command.\n\n```go\nfunc SetupRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *pflag.FlagSet, *cobra.Command)\n```\nSetupRootCommand sets default usage, help, and error handling for the root command.\n\n```go\nfunc VisitAll(root *cobra.Command, fn func(*cobra.Command))\n```\nVisitAll will traverse all commands from the root. This is different from the VisitAll of cobra.Command where only parents are checked.\n\n## Types\n\n```go\ntype Errors []error\n```\nErrors is a list of errors. Useful in a loop if you don't want to return the error right away and you want to display after the loop, all the errors that happened during the loop.\n\n```go\nfunc (errList Errors) Error() string\n```\n\n```go\ntype StatusError struct {\n\tStatus     string\n\tStatusCode int\n}\n```\nStatusError reports an unsuccessful exit by a command.\n\n```go\nfunc (e StatusError) Error() string\n```\n\n```go\ntype TopLevelCommand struct {\n\t// contains filtered or unexported fields\n}\n```\nTopLevelCommand encapsulates a top-level cobra command (either docker CLI or a plugin) and global flag handling logic necessary for plugins.\n\n```go\nfunc NewTopLevelCommand(cmd *cobra.Command, dockerCli *command.DockerCli, opts *cliflags.ClientOptions, flags *pflag.FlagSet) *TopLevelCommand\n```\nNewTopLevelCommand returns a new TopLevelCommand object\n\n```go\nfunc (tcmd *TopLevelCommand) HandleGlobalFlags() (*cobra.Command, []string, error)\n```\nHandleGlobalFlags takes care of parsing global flags defined on the command, it returns the underlying cobra command and the args it will be called with (or an error).\n\nOn success the caller is responsible for calling Initialize() before calling \\`Execute\\` on the returned command.\n\n```go\nfunc (tcmd *TopLevelCommand) Initialize(ops ...command.InitializeOpt) error\n```\nInitialize finalises global option parsing and initializes the docker client.\n\n```go\nfunc (tcmd *TopLevelCommand) SetArgs(args []string)\n```\nSetArgs sets the args (default os.Args\\[:1] used to invoke the command\n\n```go\nfunc (tcmd *TopLevelCommand) SetFlag(name, value string)\n```\nSetFlag sets a flag in the local flag set of the top-level command\n\n","path":"github.com/telecomposeio/docker-cli/cli","name":"cli","synopsis":"","isRedistributable":true}
