var ErrorSubcommandRequired … // RequireSubcommand can be used to set an empty Run function and NoArgs on a Cobra command. // This handles a case where a subcommand must be specified for a parent command 'c'. // If no subcommand is specified the CLI exist with an error. func RequireSubcommand(c *cobra.Command) { … } // ValidateExactArgNumber validates that the required top-level arguments are specified func ValidateExactArgNumber(args []string, supportedArgs []string) error { … } // GetKubeConfigPath can be used to search for a kubeconfig in standard locations // if and empty string is passed to the function. If a non-empty string is passed // the function returns the same string. func GetKubeConfigPath(file string) string { … } // AddCRISocketFlag adds the cri-socket flag to the supplied flagSet func AddCRISocketFlag(flagSet *pflag.FlagSet, criSocket *string) { … } // InteractivelyConfirmAction asks the user whether they _really_ want to take the action. func InteractivelyConfirmAction(action, question string, r io.Reader) error { … } // ValueFromFlagsOrConfig checks if the "name" flag has been set. If yes, it returns the value of the flag, otherwise it returns the value from config. func ValueFromFlagsOrConfig(flagSet *pflag.FlagSet, name string, cfgValue interface{ … } // TypeMismatchErr return an error which indicates how the type is mismatched. func TypeMismatchErr(opt, rType string) error { … }