mirror of https://github.com/kubernetes/kops.git
Minor Cobra cleanups
This commit is contained in:
parent
1f9f6fc8ce
commit
010aa2cf27
|
@ -177,14 +177,12 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
|
|||
encryptEtcdStorage := false
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "cluster [CLUSTER]",
|
||||
Short: createClusterShort,
|
||||
Long: createClusterLong,
|
||||
Example: createClusterExample,
|
||||
Args: rootCommand.clusterNameArgsNoKubeconfig(&options.ClusterName),
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
},
|
||||
Use: "cluster [CLUSTER]",
|
||||
Short: createClusterShort,
|
||||
Long: createClusterLong,
|
||||
Example: createClusterExample,
|
||||
Args: rootCommand.clusterNameArgsNoKubeconfig(&options.ClusterName),
|
||||
ValidArgsFunction: cobra.NoFileCompletions,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
var err error
|
||||
|
||||
|
|
|
@ -152,13 +152,13 @@ func NewCmdRoot(f *util.Factory, out io.Writer) *cobra.Command {
|
|||
cmd.AddCommand(NewCmdGet(f, out))
|
||||
cmd.AddCommand(commands.NewCmdHelpers(f, out))
|
||||
cmd.AddCommand(NewCmdPromote(f, out))
|
||||
cmd.AddCommand(NewCmdUpdate(f, out))
|
||||
cmd.AddCommand(NewCmdReplace(f, out))
|
||||
cmd.AddCommand(NewCmdRollingUpdate(f, out))
|
||||
cmd.AddCommand(NewCmdSet(f, out))
|
||||
cmd.AddCommand(NewCmdToolbox(f, out))
|
||||
cmd.AddCommand(NewCmdTrust(f, out))
|
||||
cmd.AddCommand(NewCmdUnset(f, out))
|
||||
cmd.AddCommand(NewCmdUpdate(f, out))
|
||||
cmd.AddCommand(NewCmdUpgrade(f, out))
|
||||
cmd.AddCommand(NewCmdValidate(f, out))
|
||||
cmd.AddCommand(NewCmdVersion(f, out))
|
||||
|
|
|
@ -41,14 +41,12 @@ func NewCmdVersion(f *util.Factory, out io.Writer) *cobra.Command {
|
|||
options := &commands.VersionOptions{}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "version",
|
||||
Short: versionShort,
|
||||
Long: versionLong,
|
||||
Example: versionExample,
|
||||
Args: cobra.NoArgs,
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
},
|
||||
Use: "version",
|
||||
Short: versionShort,
|
||||
Long: versionLong,
|
||||
Example: versionExample,
|
||||
Args: cobra.NoArgs,
|
||||
ValidArgsFunction: cobra.NoFileCompletions,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return commands.RunVersion(f, out, options)
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue