Documentation
¶
Index ¶
- Constants
- func AddClusterDefinitionFlag(f cmdutil.Factory, cmd *cobra.Command, p *string)
- func AddComponentFlag(f cmdutil.Factory, cmd *cobra.Command, p *string, usage string)
- func AddComponentsFlag(f cmdutil.Factory, cmd *cobra.Command, p *[]string, usage string)
- func BuildFlagsBySchema(cmd *cobra.Command, schema *spec.Schema) error
- func BuildFlagsWithOpenAPISchema(cmd *cobra.Command, args []string, ...) error
- func FlagsToValues(fs *pflag.FlagSet, explicit bool) map[string]pflag.Value
- type TmpFlagSet
Constants ¶
View Source
const (
CobraInt = "int"
CobraSting = "string"
CobraBool = "bool"
CobraFloat64 = "float64"
CobraStringArray = "stringArray"
CobraIntSlice = "intSlice"
CobraFloat64Slice = "float64Slice"
CobraBoolSlice = "boolSlice"
)
Variables ¶
This section is empty.
Functions ¶
func AddClusterDefinitionFlag ¶
func AddClusterDefinitionFlag(f cmdutil.Factory, cmd *cobra.Command, p *string)
AddClusterDefinitionFlag adds a flag "cluster-definition" for the cmd and stores the value of the flag in string p
func AddComponentFlag ¶
func AddComponentFlag(f cmdutil.Factory, cmd *cobra.Command, p *string, usage string)
AddComponentFlag add flag "component" for cobra.Command and support auto complete for it
func AddComponentsFlag ¶
func AddComponentsFlag(f cmdutil.Factory, cmd *cobra.Command, p *[]string, usage string)
AddComponentsFlag add flag "components" for cobra.Command and support auto complete for it
func BuildFlagsBySchema ¶
func BuildFlagsBySchema(cmd *cobra.Command, schema *spec.Schema) error
BuildFlagsBySchema builds a flag.FlagSet by the given schema, convert the schema key to flag name, and convert the schema type to flag type.
func BuildFlagsWithOpenAPISchema ¶ added in v0.7.2
func BuildFlagsWithOpenAPISchema(cmd *cobra.Command,
args []string,
getOpenAPISchema func() (*apiextensionsv1.JSONSchemaProps, error)) error
BuildFlagsWithOpenAPISchema builds the flag from openAPIV3Schema properties.
func FlagsToValues ¶ added in v0.7.2
func FlagsToValues(fs *pflag.FlagSet, explicit bool) map[string]pflag.Value
Types ¶
type TmpFlagSet ¶ added in v0.7.2
type TmpFlagSet struct {
*pflag.FlagSet
// help flag
Help bool
}
TmpFlagSet create a tmpFlagSet to handle your custom flags and args.
func NewTmpFlagSet ¶ added in v0.7.2
func NewTmpFlagSet() *TmpFlagSet
Click to show internal directories.
Click to hide internal directories.