Documentation ¶
Index ¶
- func AddLatestFlag(cmd *cobra.Command, b *bool)
- func CheckAllLatestAndCIDFile(c *cobra.Command, args []string, ignoreArgLen bool, cidfile bool) error
- func CheckAllLatestAndIDFile(c *cobra.Command, args []string, ignoreArgLen bool, idFileFlag string) error
- func CheckAllLatestAndPodIDFile(c *cobra.Command, args []string, ignoreArgLen bool, withIDFile bool) error
- func IDOrLatestArgs(cmd *cobra.Command, args []string) error
- func NoArgs(cmd *cobra.Command, args []string) error
- func NoOp(_ *cobra.Command, _ []string) error
- func SubCommandExists(cmd *cobra.Command, args []string) error
- type ChoiceValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLatestFlag ¶
func CheckAllLatestAndCIDFile ¶
func CheckAllLatestAndCIDFile(c *cobra.Command, args []string, ignoreArgLen bool, cidfile bool) error
CheckAllLatestAndCIDFile checks that --all and --latest are used correctly for containers and pods If idFileFlag is set is set, also checks for the --cidfile or --pod-id-file flag. Note: this has been deprecated, use CheckAllLatestAndIDFile instead
func CheckAllLatestAndIDFile ¶ added in v4.1.1
func CheckAllLatestAndIDFile(c *cobra.Command, args []string, ignoreArgLen bool, idFileFlag string) error
CheckAllLatestAndIDFile checks that --all and --latest are used correctly for containers and pods If idFileFlag is set is set, also checks for the --cidfile or --pod-id-file flag.
func CheckAllLatestAndPodIDFile ¶
func CheckAllLatestAndPodIDFile(c *cobra.Command, args []string, ignoreArgLen bool, withIDFile bool) error
CheckAllLatestAndPodIDFile checks that --all and --latest are used correctly. If withIDFile is set, also check for the --pod-id-file flag. Note: this has been deprecated, use CheckAllLatestAndIDFile instead
func IDOrLatestArgs ¶
IDOrLatestArgs used to validate a nameOrId was provided or the "--latest" flag
Types ¶
type ChoiceValue ¶
type ChoiceValue struct {
// contains filtered or unexported fields
}
Honors cobra.Value interface
func Value ¶
func Value(p *string, choices ...string) *ChoiceValue
Value may be used in cobra FlagSet methods Var/VarP/VarPF() to select from a set of values
Example:
created := validate.ChoiceValue(&opts.Sort, "command", "created", "id", "image", "names", "runningfor", "size", "status") flags.Var(created, "sort", "Sort output by: "+created.Choices())
func (*ChoiceValue) Choices ¶
func (c *ChoiceValue) Choices() string
func (*ChoiceValue) Set ¶
func (c *ChoiceValue) Set(value string) error
func (*ChoiceValue) String ¶
func (c *ChoiceValue) String() string
func (*ChoiceValue) Type ¶
func (c *ChoiceValue) Type() string