diff --git a/cmd/helm/chart.go b/cmd/helm/chart.go index adc874cfe..35a185dfa 100644 --- a/cmd/helm/chart.go +++ b/cmd/helm/chart.go @@ -31,11 +31,12 @@ The subcommands can be used to push, pull, tag, list, or remove Helm charts. func newChartCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "chart", - Short: "push, pull, tag, or remove Helm charts", - Long: chartHelp, - Hidden: !FeatureGateOCI.IsEnabled(), - PersistentPreRunE: checkOCIFeatureGate(), + Use: "chart", + DisableFlagsInUseLine: true, + Short: "push, pull, tag, or remove Helm charts", + Long: chartHelp, + Hidden: !FeatureGateOCI.IsEnabled(), + PersistentPreRunE: checkOCIFeatureGate(), } cmd.AddCommand( newChartListCmd(cfg, out), diff --git a/cmd/helm/chart_export.go b/cmd/helm/chart_export.go index 67caf08d7..70a484c97 100644 --- a/cmd/helm/chart_export.go +++ b/cmd/helm/chart_export.go @@ -37,11 +37,12 @@ func newChartExportCmd(cfg *action.Configuration, out io.Writer) *cobra.Command client := action.NewChartExport(cfg) cmd := &cobra.Command{ - Use: "export [ref]", - Short: "export a chart to directory", - Long: chartExportDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "export [ref]", + DisableFlagsInUseLine: true, + Short: "export a chart to directory", + Long: chartExportDesc, + Args: require.MinimumNArgs(1), + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { ref := args[0] return client.Run(out, ref) diff --git a/cmd/helm/chart_list.go b/cmd/helm/chart_list.go index a9d01c9bd..a86e3069b 100644 --- a/cmd/helm/chart_list.go +++ b/cmd/helm/chart_list.go @@ -32,11 +32,12 @@ Charts are sorted by ref name, alphabetically. func newChartListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return &cobra.Command{ - Use: "list", - Aliases: []string{"ls"}, - Short: "list all saved charts", - Long: chartListDesc, - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "list", + DisableFlagsInUseLine: true, + Aliases: []string{"ls"}, + Short: "list all saved charts", + Long: chartListDesc, + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { return action.NewChartList(cfg).Run(out) }, diff --git a/cmd/helm/chart_pull.go b/cmd/helm/chart_pull.go index 760ff3e2c..6a4cc3212 100644 --- a/cmd/helm/chart_pull.go +++ b/cmd/helm/chart_pull.go @@ -33,11 +33,12 @@ This will store the chart in the local registry cache to be used later. func newChartPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return &cobra.Command{ - Use: "pull [ref]", - Short: "pull a chart from remote", - Long: chartPullDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "pull [ref]", + DisableFlagsInUseLine: true, + Short: "pull a chart from remote", + Long: chartPullDesc, + Args: require.MinimumNArgs(1), + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { ref := args[0] return action.NewChartPull(cfg).Run(out, ref) diff --git a/cmd/helm/chart_push.go b/cmd/helm/chart_push.go index ff34632b1..b9f0d90f7 100644 --- a/cmd/helm/chart_push.go +++ b/cmd/helm/chart_push.go @@ -35,11 +35,12 @@ Must first run "helm chart save" or "helm chart pull". func newChartPushCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return &cobra.Command{ - Use: "push [ref]", - Short: "push a chart to remote", - Long: chartPushDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "push [ref]", + DisableFlagsInUseLine: true, + Short: "push a chart to remote", + Long: chartPushDesc, + Args: require.MinimumNArgs(1), + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { ref := args[0] return action.NewChartPush(cfg).Run(out, ref) diff --git a/cmd/helm/chart_remove.go b/cmd/helm/chart_remove.go index d952951fb..8916fd9e0 100644 --- a/cmd/helm/chart_remove.go +++ b/cmd/helm/chart_remove.go @@ -36,12 +36,13 @@ To remove all unlinked content, please run "helm chart prune". (TODO) func newChartRemoveCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return &cobra.Command{ - Use: "remove [ref]", - Aliases: []string{"rm"}, - Short: "remove a chart", - Long: chartRemoveDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "remove [ref]", + DisableFlagsInUseLine: true, + Aliases: []string{"rm"}, + Short: "remove a chart", + Long: chartRemoveDesc, + Args: require.MinimumNArgs(1), + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { ref := args[0] return action.NewChartRemove(cfg).Run(out, ref) diff --git a/cmd/helm/chart_save.go b/cmd/helm/chart_save.go index 35b72cd07..341b85842 100644 --- a/cmd/helm/chart_save.go +++ b/cmd/helm/chart_save.go @@ -18,6 +18,7 @@ package main import ( "io" + "k8s.io/kubectl/pkg/util/templates" "path/filepath" "github.com/spf13/cobra" @@ -36,11 +37,12 @@ not change the item as it exists in the cache. func newChartSaveCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return &cobra.Command{ - Use: "save [path] [ref]", - Short: "save a chart directory", - Long: chartSaveDesc, - Args: require.MinimumNArgs(2), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "save [path] [ref]", + DisableFlagsInUseLine: true, + Short: templates.LongDesc("save a chart directory"), + Long: chartSaveDesc, + Args: require.MinimumNArgs(2), + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { path := args[0] ref := args[1] diff --git a/cmd/helm/completion.go b/cmd/helm/completion.go index c1f7790bc..508adfddc 100644 --- a/cmd/helm/completion.go +++ b/cmd/helm/completion.go @@ -51,9 +51,10 @@ func newCompletionCmd(out io.Writer) *cobra.Command { } cmd := &cobra.Command{ - Use: "completion SHELL", - Short: "generate autocompletions script for the specified shell (bash or zsh)", - Long: completionDesc, + Use: "completion SHELL", + DisableFlagsInUseLine: true, + Short: "generate autocompletions script for the specified shell (bash or zsh)", + Long: completionDesc, RunE: func(cmd *cobra.Command, args []string) error { return runCompletion(out, cmd, args) }, diff --git a/cmd/helm/create.go b/cmd/helm/create.go index 5bdda05cb..7a9a9eaff 100644 --- a/cmd/helm/create.go +++ b/cmd/helm/create.go @@ -60,10 +60,11 @@ func newCreateCmd(out io.Writer) *cobra.Command { o := &createOptions{} cmd := &cobra.Command{ - Use: "create NAME", - Short: "create a new chart with the given name", - Long: createDesc, - Args: require.ExactArgs(1), + Use: "create NAME", + DisableFlagsInUseLine: true, + Short: "create a new chart with the given name", + Long: createDesc, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { o.name = args[0] o.starterDir = helmpath.DataPath("starters") diff --git a/cmd/helm/dependency.go b/cmd/helm/dependency.go index 2cc4c5045..44f43ca66 100644 --- a/cmd/helm/dependency.go +++ b/cmd/helm/dependency.go @@ -84,11 +84,12 @@ This will produce an error if the chart cannot be loaded. func newDependencyCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "dependency update|build|list", - Aliases: []string{"dep", "dependencies"}, - Short: "manage a chart's dependencies", - Long: dependencyDesc, - Args: require.NoArgs, + Use: "dependency update|build|list", + DisableFlagsInUseLine: true, + Aliases: []string{"dep", "dependencies"}, + Short: "manage a chart's dependencies", + Long: dependencyDesc, + Args: require.NoArgs, } cmd.AddCommand(newDependencyListCmd(out)) @@ -102,11 +103,12 @@ func newDependencyListCmd(out io.Writer) *cobra.Command { client := action.NewDependency() cmd := &cobra.Command{ - Use: "list CHART", - Aliases: []string{"ls"}, - Short: "list the dependencies for the given chart", - Long: dependencyListDesc, - Args: require.MaximumNArgs(1), + Use: "list CHART", + DisableFlagsInUseLine: true, + Aliases: []string{"ls"}, + Short: "list the dependencies for the given chart", + Long: dependencyListDesc, + Args: require.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { chartpath := "." if len(args) > 0 { diff --git a/cmd/helm/dependency_build.go b/cmd/helm/dependency_build.go index 478b49479..21218e639 100644 --- a/cmd/helm/dependency_build.go +++ b/cmd/helm/dependency_build.go @@ -44,10 +44,11 @@ func newDependencyBuildCmd(out io.Writer) *cobra.Command { client := action.NewDependency() cmd := &cobra.Command{ - Use: "build CHART", - Short: "rebuild the charts/ directory based on the Chart.lock file", - Long: dependencyBuildDesc, - Args: require.MaximumNArgs(1), + Use: "build CHART", + DisableFlagsInUseLine: true, + Short: "rebuild the charts/ directory based on the Chart.lock file", + Long: dependencyBuildDesc, + Args: require.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { chartpath := "." if len(args) > 0 { diff --git a/cmd/helm/dependency_update.go b/cmd/helm/dependency_update.go index 9855afb92..956523536 100644 --- a/cmd/helm/dependency_update.go +++ b/cmd/helm/dependency_update.go @@ -47,11 +47,12 @@ func newDependencyUpdateCmd(out io.Writer) *cobra.Command { client := action.NewDependency() cmd := &cobra.Command{ - Use: "update CHART", - Aliases: []string{"up"}, - Short: "update charts/ based on the contents of Chart.yaml", - Long: dependencyUpDesc, - Args: require.MaximumNArgs(1), + Use: "update CHART", + DisableFlagsInUseLine: true, + Aliases: []string{"up"}, + Short: "update charts/ based on the contents of Chart.yaml", + Long: dependencyUpDesc, + Args: require.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { chartpath := "." if len(args) > 0 { diff --git a/cmd/helm/docs.go b/cmd/helm/docs.go index c974d4014..3d5926eec 100644 --- a/cmd/helm/docs.go +++ b/cmd/helm/docs.go @@ -47,11 +47,12 @@ func newDocsCmd(out io.Writer) *cobra.Command { o := &docsOptions{} cmd := &cobra.Command{ - Use: "docs", - Short: "generate documentation as markdown or man pages", - Long: docsDesc, - Hidden: true, - Args: require.NoArgs, + Use: "docs", + DisableFlagsInUseLine: true, + Short: "generate documentation as markdown or man pages", + Long: docsDesc, + Hidden: true, + Args: require.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { o.topCmd = cmd.Root() return o.run(out) diff --git a/cmd/helm/env.go b/cmd/helm/env.go index 0fbfb9da4..5a981670d 100644 --- a/cmd/helm/env.go +++ b/cmd/helm/env.go @@ -32,10 +32,11 @@ Env prints out all the environment information in use by Helm. func newEnvCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "env", - Short: "helm client environment information", - Long: envHelp, - Args: require.NoArgs, + Use: "env", + DisableFlagsInUseLine: true, + Short: "helm client environment information", + Long: envHelp, + Args: require.NoArgs, Run: func(cmd *cobra.Command, args []string) { envVars := settings.EnvVars() diff --git a/cmd/helm/get.go b/cmd/helm/get.go index 7c4854b59..356604715 100644 --- a/cmd/helm/get.go +++ b/cmd/helm/get.go @@ -37,10 +37,11 @@ get extended information about the release, including: func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "get", - Short: "download extended information of a named release", - Long: getHelp, - Args: require.NoArgs, + Use: "get", + DisableFlagsInUseLine: true, + Short: "download extended information of a named release", + Long: getHelp, + Args: require.NoArgs, } cmd.AddCommand(newGetAllCmd(cfg, out)) diff --git a/cmd/helm/get_all.go b/cmd/helm/get_all.go index 7d893d7e0..999aeadaa 100644 --- a/cmd/helm/get_all.go +++ b/cmd/helm/get_all.go @@ -37,10 +37,11 @@ func newGetAllCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client := action.NewGet(cfg) cmd := &cobra.Command{ - Use: "all RELEASE_NAME", - Short: "download all information for a named release", - Long: getAllHelp, - Args: require.ExactArgs(1), + Use: "all RELEASE_NAME", + DisableFlagsInUseLine: true, + Short: "download all information for a named release", + Long: getAllHelp, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { res, err := client.Run(args[0]) if err != nil { diff --git a/cmd/helm/get_hooks.go b/cmd/helm/get_hooks.go index c2087b1ba..0796ef28a 100644 --- a/cmd/helm/get_hooks.go +++ b/cmd/helm/get_hooks.go @@ -37,10 +37,11 @@ func newGetHooksCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client := action.NewGet(cfg) cmd := &cobra.Command{ - Use: "hooks RELEASE_NAME", - Short: "download all hooks for a named release", - Long: getHooksHelp, - Args: require.ExactArgs(1), + Use: "hooks RELEASE_NAME", + DisableFlagsInUseLine: true, + Short: "download all hooks for a named release", + Long: getHooksHelp, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { res, err := client.Run(args[0]) if err != nil { diff --git a/cmd/helm/get_manifest.go b/cmd/helm/get_manifest.go index f332befd9..3502c131c 100644 --- a/cmd/helm/get_manifest.go +++ b/cmd/helm/get_manifest.go @@ -39,10 +39,11 @@ func newGetManifestCmd(cfg *action.Configuration, out io.Writer) *cobra.Command client := action.NewGet(cfg) cmd := &cobra.Command{ - Use: "manifest RELEASE_NAME", - Short: "download the manifest for a named release", - Long: getManifestHelp, - Args: require.ExactArgs(1), + Use: "manifest RELEASE_NAME", + DisableFlagsInUseLine: true, + Short: "download the manifest for a named release", + Long: getManifestHelp, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { res, err := client.Run(args[0]) if err != nil { diff --git a/cmd/helm/get_notes.go b/cmd/helm/get_notes.go index 4491bd9ba..f9405df36 100644 --- a/cmd/helm/get_notes.go +++ b/cmd/helm/get_notes.go @@ -35,10 +35,11 @@ func newGetNotesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client := action.NewGet(cfg) cmd := &cobra.Command{ - Use: "notes RELEASE_NAME", - Short: "download the notes for a named release", - Long: getNotesHelp, - Args: require.ExactArgs(1), + Use: "notes RELEASE_NAME", + DisableFlagsInUseLine: true, + Short: "download the notes for a named release", + Long: getNotesHelp, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { res, err := client.Run(args[0]) if err != nil { diff --git a/cmd/helm/get_values.go b/cmd/helm/get_values.go index a8c5acc5e..cd049345e 100644 --- a/cmd/helm/get_values.go +++ b/cmd/helm/get_values.go @@ -42,10 +42,11 @@ func newGetValuesCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client := action.NewGetValues(cfg) cmd := &cobra.Command{ - Use: "values RELEASE_NAME", - Short: "download the values file for a named release", - Long: getValuesHelp, - Args: require.ExactArgs(1), + Use: "values RELEASE_NAME", + DisableFlagsInUseLine: true, + Short: "download the values file for a named release", + Long: getValuesHelp, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { vals, err := client.Run(args[0]) if err != nil { diff --git a/cmd/helm/history.go b/cmd/helm/history.go index 3ef542e58..6f116ab1e 100644 --- a/cmd/helm/history.go +++ b/cmd/helm/history.go @@ -56,11 +56,12 @@ func newHistoryCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { var outfmt output.Format cmd := &cobra.Command{ - Use: "history RELEASE_NAME", - Long: historyHelp, - Short: "fetch release history", - Aliases: []string{"hist"}, - Args: require.ExactArgs(1), + Use: "history RELEASE_NAME", + DisableFlagsInUseLine: true, + Long: historyHelp, + Short: "fetch release history", + Aliases: []string{"hist"}, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { history, err := getHistory(client, args[0]) if err != nil { diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 21a41b9f9..5cf2a4996 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -109,10 +109,11 @@ func newInstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { var outfmt output.Format cmd := &cobra.Command{ - Use: "install [NAME] [CHART]", - Short: "install a chart", - Long: installDesc, - Args: require.MinimumNArgs(1), + Use: "install [NAME] [CHART]", + DisableFlagsInUseLine: true, + Short: "install a chart", + Long: installDesc, + Args: require.MinimumNArgs(1), RunE: func(_ *cobra.Command, args []string) error { rel, err := runInstall(args, client, valueOpts, out) if err != nil { diff --git a/cmd/helm/lint.go b/cmd/helm/lint.go index a7aac172a..4f9644141 100644 --- a/cmd/helm/lint.go +++ b/cmd/helm/lint.go @@ -45,9 +45,10 @@ func newLintCmd(out io.Writer) *cobra.Command { valueOpts := &values.Options{} cmd := &cobra.Command{ - Use: "lint PATH", - Short: "examine a chart for possible issues", - Long: longLintHelp, + Use: "lint PATH", + DisableFlagsInUseLine: true, + Short: "examine a chart for possible issues", + Long: longLintHelp, RunE: func(cmd *cobra.Command, args []string) error { paths := []string{"."} if len(args) > 0 { diff --git a/cmd/helm/list.go b/cmd/helm/list.go index 08d6beb79..31e89faa7 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -64,11 +64,12 @@ func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { var outfmt output.Format cmd := &cobra.Command{ - Use: "list", - Short: "list releases", - Long: listHelp, - Aliases: []string{"ls"}, - Args: require.NoArgs, + Use: "list", + DisableFlagsInUseLine: true, + Short: "list releases", + Long: listHelp, + Aliases: []string{"ls"}, + Args: require.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { if client.AllNamespaces { if err := cfg.Init(settings.RESTClientGetter(), "", os.Getenv("HELM_DRIVER"), debug); err != nil { diff --git a/cmd/helm/options.go b/cmd/helm/options.go index b6bbb6dff..b47aa17e8 100644 --- a/cmd/helm/options.go +++ b/cmd/helm/options.go @@ -26,10 +26,11 @@ import ( // NewCmdOptions implements the options command func newCmdOptions(out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "options", - Short: "print the list of flags inherited by all commands", - Long: "print the list of flags inherited by all commands", - Args: require.NoArgs, + Use: "options", + DisableFlagsInUseLine: true, + Short: "print the list of flags inherited by all commands", + Long: "print the list of flags inherited by all commands", + Args: require.NoArgs, Run: func(cmd *cobra.Command, args []string) { cmd.Usage() }, diff --git a/cmd/helm/package.go b/cmd/helm/package.go index 00fe0ef11..fffbf4b1c 100644 --- a/cmd/helm/package.go +++ b/cmd/helm/package.go @@ -53,9 +53,10 @@ func newPackageCmd(out io.Writer) *cobra.Command { valueOpts := &values.Options{} cmd := &cobra.Command{ - Use: "package [CHART_PATH] [...]", - Short: "package a chart directory into a chart archive", - Long: packageDesc, + Use: "package [CHART_PATH] [...]", + DisableFlagsInUseLine: true, + Short: "package a chart directory into a chart archive", + Long: packageDesc, RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.Errorf("need at least one argument, the path to the chart") diff --git a/cmd/helm/plugin.go b/cmd/helm/plugin.go index 8e1044f54..545bb709c 100644 --- a/cmd/helm/plugin.go +++ b/cmd/helm/plugin.go @@ -32,9 +32,10 @@ Manage client-side Helm plugins. func newPluginCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "plugin", - Short: "install, list, or uninstall Helm plugins", - Long: pluginHelp, + Use: "plugin", + DisableFlagsInUseLine: true, + Short: "install, list, or uninstall Helm plugins", + Long: pluginHelp, } cmd.AddCommand( newPluginInstallCmd(out), diff --git a/cmd/helm/plugin_install.go b/cmd/helm/plugin_install.go index 8deb1f4f9..6a3aeeca2 100644 --- a/cmd/helm/plugin_install.go +++ b/cmd/helm/plugin_install.go @@ -38,11 +38,12 @@ This command allows you to install a plugin from a url to a VCS repo or a local func newPluginInstallCmd(out io.Writer) *cobra.Command { o := &pluginInstallOptions{} cmd := &cobra.Command{ - Use: "install [options] ...", - Short: "install one or more Helm plugins", - Long: pluginInstallDesc, - Aliases: []string{"add"}, - Args: require.ExactArgs(1), + Use: "install [options] ...", + DisableFlagsInUseLine: true, + Short: "install one or more Helm plugins", + Long: pluginInstallDesc, + Aliases: []string{"add"}, + Args: require.ExactArgs(1), PreRunE: func(cmd *cobra.Command, args []string) error { return o.complete(args) }, diff --git a/cmd/helm/plugin_list.go b/cmd/helm/plugin_list.go index 49a454963..e41659a9d 100644 --- a/cmd/helm/plugin_list.go +++ b/cmd/helm/plugin_list.go @@ -28,9 +28,10 @@ import ( func newPluginListCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "list", - Aliases: []string{"ls"}, - Short: "list installed Helm plugins", + Use: "list", + DisableFlagsInUseLine: true, + Aliases: []string{"ls"}, + Short: "list installed Helm plugins", RunE: func(cmd *cobra.Command, args []string) error { debug("pluginDirs: %s", settings.PluginsDirectory) plugins, err := plugin.FindPlugins(settings.PluginsDirectory) diff --git a/cmd/helm/plugin_uninstall.go b/cmd/helm/plugin_uninstall.go index 66cdaccdc..d13196225 100644 --- a/cmd/helm/plugin_uninstall.go +++ b/cmd/helm/plugin_uninstall.go @@ -36,9 +36,10 @@ func newPluginUninstallCmd(out io.Writer) *cobra.Command { o := &pluginUninstallOptions{} cmd := &cobra.Command{ - Use: "uninstall ...", - Aliases: []string{"rm", "remove"}, - Short: "uninstall one or more Helm plugins", + Use: "uninstall ...", + DisableFlagsInUseLine: true, + Aliases: []string{"rm", "remove"}, + Short: "uninstall one or more Helm plugins", PreRunE: func(cmd *cobra.Command, args []string) error { return o.complete(args) }, diff --git a/cmd/helm/plugin_update.go b/cmd/helm/plugin_update.go index 23f840b4a..f597c35fd 100644 --- a/cmd/helm/plugin_update.go +++ b/cmd/helm/plugin_update.go @@ -37,9 +37,10 @@ func newPluginUpdateCmd(out io.Writer) *cobra.Command { o := &pluginUpdateOptions{} cmd := &cobra.Command{ - Use: "update ...", - Aliases: []string{"up"}, - Short: "update one or more Helm plugins", + Use: "update ...", + DisableFlagsInUseLine: true, + Aliases: []string{"up"}, + Short: "update one or more Helm plugins", PreRunE: func(cmd *cobra.Command, args []string) error { return o.complete(args) }, diff --git a/cmd/helm/pull.go b/cmd/helm/pull.go index 16cd10467..95ed42989 100644 --- a/cmd/helm/pull.go +++ b/cmd/helm/pull.go @@ -46,11 +46,12 @@ func newPullCmd(out io.Writer) *cobra.Command { client := action.NewPull() cmd := &cobra.Command{ - Use: "pull [chart URL | repo/chartname] [...]", - Short: "download a chart from a repository and (optionally) unpack it in local directory", - Aliases: []string{"fetch"}, - Long: pullDesc, - Args: require.MinimumNArgs(1), + Use: "pull [chart URL | repo/chartname] [...]", + DisableFlagsInUseLine: true, + Short: "download a chart from a repository and (optionally) unpack it in local directory", + Aliases: []string{"fetch"}, + Long: pullDesc, + Args: require.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client.Settings = settings if client.Version == "" && client.Devel { diff --git a/cmd/helm/registry.go b/cmd/helm/registry.go index d13c308b2..cb6d5af03 100644 --- a/cmd/helm/registry.go +++ b/cmd/helm/registry.go @@ -29,11 +29,12 @@ This command consists of multiple subcommands to interact with registries. func newRegistryCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "registry", - Short: "login to or logout from a registry", - Long: registryHelp, - Hidden: !FeatureGateOCI.IsEnabled(), - PersistentPreRunE: checkOCIFeatureGate(), + Use: "registry", + DisableFlagsInUseLine: true, + Short: "login to or logout from a registry", + Long: registryHelp, + Hidden: !FeatureGateOCI.IsEnabled(), + PersistentPreRunE: checkOCIFeatureGate(), } cmd.AddCommand( newRegistryLoginCmd(cfg, out), diff --git a/cmd/helm/registry_login.go b/cmd/helm/registry_login.go index e3435bf9d..e88807f53 100644 --- a/cmd/helm/registry_login.go +++ b/cmd/helm/registry_login.go @@ -41,11 +41,12 @@ func newRegistryLoginCmd(cfg *action.Configuration, out io.Writer) *cobra.Comman var passwordFromStdinOpt, insecureOpt bool cmd := &cobra.Command{ - Use: "login [host]", - Short: "login to a registry", - Long: registryLoginDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "login [host]", + DisableFlagsInUseLine: true, + Short: "login to a registry", + Long: registryLoginDesc, + Args: require.MinimumNArgs(1), + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { hostname := args[0] diff --git a/cmd/helm/registry_logout.go b/cmd/helm/registry_logout.go index e7e1a24fe..ea172f48e 100644 --- a/cmd/helm/registry_logout.go +++ b/cmd/helm/registry_logout.go @@ -31,11 +31,12 @@ Remove credentials stored for a remote registry. func newRegistryLogoutCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { return &cobra.Command{ - Use: "logout [host]", - Short: "logout from a registry", - Long: registryLogoutDesc, - Args: require.MinimumNArgs(1), - Hidden: !FeatureGateOCI.IsEnabled(), + Use: "logout [host]", + DisableFlagsInUseLine: true, + Short: "logout from a registry", + Long: registryLogoutDesc, + Args: require.MinimumNArgs(1), + Hidden: !FeatureGateOCI.IsEnabled(), RunE: func(cmd *cobra.Command, args []string) error { hostname := args[0] return action.NewRegistryLogout(cfg).Run(out, hostname) diff --git a/cmd/helm/repo.go b/cmd/helm/repo.go index ad6ceaa8f..2a3bdf65f 100644 --- a/cmd/helm/repo.go +++ b/cmd/helm/repo.go @@ -34,10 +34,11 @@ It can be used to add, remove, list, and index chart repositories. func newRepoCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "repo add|remove|list|index|update [ARGS]", - Short: "add, list, remove, update, and index chart repositories", - Long: repoHelm, - Args: require.NoArgs, + Use: "repo add|remove|list|index|update [ARGS]", + DisableFlagsInUseLine: true, + Short: "add, list, remove, update, and index chart repositories", + Long: repoHelm, + Args: require.NoArgs, } cmd.AddCommand(newRepoAddCmd(out)) diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index 3d36fd0ed..fb90f49eb 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -56,9 +56,10 @@ func newRepoAddCmd(out io.Writer) *cobra.Command { o := &repoAddOptions{} cmd := &cobra.Command{ - Use: "add [NAME] [URL]", - Short: "add a chart repository", - Args: require.ExactArgs(2), + Use: "add [NAME] [URL]", + DisableFlagsInUseLine: true, + Short: "add a chart repository", + Args: require.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { o.name = args[0] o.url = args[1] diff --git a/cmd/helm/repo_index.go b/cmd/helm/repo_index.go index 63afaf37b..6349e897d 100644 --- a/cmd/helm/repo_index.go +++ b/cmd/helm/repo_index.go @@ -49,10 +49,11 @@ func newRepoIndexCmd(out io.Writer) *cobra.Command { o := &repoIndexOptions{} cmd := &cobra.Command{ - Use: "index [DIR]", - Short: "generate an index file given a directory containing packaged charts", - Long: repoIndexDesc, - Args: require.ExactArgs(1), + Use: "index [DIR]", + DisableFlagsInUseLine: true, + Short: "generate an index file given a directory containing packaged charts", + Long: repoIndexDesc, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { o.dir = args[0] return o.run(out) diff --git a/cmd/helm/repo_list.go b/cmd/helm/repo_list.go index ed1c9573c..ef378fd7a 100644 --- a/cmd/helm/repo_list.go +++ b/cmd/helm/repo_list.go @@ -32,10 +32,11 @@ import ( func newRepoListCmd(out io.Writer) *cobra.Command { var outfmt output.Format cmd := &cobra.Command{ - Use: "list", - Aliases: []string{"ls"}, - Short: "list chart repositories", - Args: require.NoArgs, + Use: "list", + DisableFlagsInUseLine: true, + Aliases: []string{"ls"}, + Short: "list chart repositories", + Args: require.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { f, err := repo.LoadFile(settings.RepositoryConfig) if isNotExist(err) || (len(f.Repositories) == 0 && !(outfmt == output.JSON || outfmt == output.YAML)) { diff --git a/cmd/helm/repo_remove.go b/cmd/helm/repo_remove.go index 5dad4e5e0..cea7678f5 100644 --- a/cmd/helm/repo_remove.go +++ b/cmd/helm/repo_remove.go @@ -41,10 +41,11 @@ func newRepoRemoveCmd(out io.Writer) *cobra.Command { o := &repoRemoveOptions{} cmd := &cobra.Command{ - Use: "remove [REPO1 [REPO2 ...]]", - Aliases: []string{"rm"}, - Short: "remove one or more chart repositories", - Args: require.MinimumNArgs(1), + Use: "remove [REPO1 [REPO2 ...]]", + DisableFlagsInUseLine: true, + Aliases: []string{"rm"}, + Short: "remove one or more chart repositories", + Args: require.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { o.repoFile = settings.RepositoryConfig o.repoCache = settings.RepositoryCache diff --git a/cmd/helm/repo_update.go b/cmd/helm/repo_update.go index 027f18518..7cfe4ba38 100644 --- a/cmd/helm/repo_update.go +++ b/cmd/helm/repo_update.go @@ -45,11 +45,12 @@ func newRepoUpdateCmd(out io.Writer) *cobra.Command { o := &repoUpdateOptions{update: updateCharts} cmd := &cobra.Command{ - Use: "update", - Aliases: []string{"up"}, - Short: "update information of available charts locally from chart repositories", - Long: updateDesc, - Args: require.NoArgs, + Use: "update", + DisableFlagsInUseLine: true, + Aliases: []string{"up"}, + Short: "update information of available charts locally from chart repositories", + Long: updateDesc, + Args: require.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { o.repoFile = settings.RepositoryConfig return o.run(out) diff --git a/cmd/helm/rollback.go b/cmd/helm/rollback.go index 745e910b2..4d63b918a 100644 --- a/cmd/helm/rollback.go +++ b/cmd/helm/rollback.go @@ -43,10 +43,11 @@ func newRollbackCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client := action.NewRollback(cfg) cmd := &cobra.Command{ - Use: "rollback [REVISION]", - Short: "roll back a release to a previous revision", - Long: rollbackDesc, - Args: require.MinimumNArgs(1), + Use: "rollback [REVISION]", + DisableFlagsInUseLine: true, + Short: "roll back a release to a previous revision", + Long: rollbackDesc, + Args: require.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { if len(args) > 1 { ver, err := strconv.Atoi(args[1]) diff --git a/cmd/helm/root.go b/cmd/helm/root.go index ac52c1e12..882054865 100644 --- a/cmd/helm/root.go +++ b/cmd/helm/root.go @@ -71,13 +71,14 @@ By default, the default directories depend on the Operating System. The defaults func newRootCmd(actionConfig *action.Configuration, out io.Writer, args []string) *cobra.Command { cmd := &cobra.Command{ - Use: "helm", - Short: "The Helm package manager for Kubernetes.", - Long: globalUsage, + Use: "helm", + DisableFlagsInUseLine: true, + Short: "The Helm package manager for Kubernetes.", + Long: globalUsage, Run: func(cmd *cobra.Command, args []string) { cmd.Help() }, - SilenceUsage: true, + SilenceUsage: false, BashCompletionFunction: completion.GetBashCustomFunction(), } flags := cmd.PersistentFlags() diff --git a/cmd/helm/search.go b/cmd/helm/search.go index 240d5e7c7..f7b2c04aa 100644 --- a/cmd/helm/search.go +++ b/cmd/helm/search.go @@ -31,9 +31,10 @@ search subcommands to search different locations for charts. func newSearchCmd(out io.Writer) *cobra.Command { cmd := &cobra.Command{ - Use: "search [keyword]", - Short: "search for a keyword in charts", - Long: searchDesc, + Use: "search [keyword]", + DisableFlagsInUseLine: true, + Short: "search for a keyword in charts", + Long: searchDesc, } cmd.AddCommand(newSearchHubCmd(out)) diff --git a/cmd/helm/search_hub.go b/cmd/helm/search_hub.go index 89139ec16..379a009a0 100644 --- a/cmd/helm/search_hub.go +++ b/cmd/helm/search_hub.go @@ -51,9 +51,10 @@ func newSearchHubCmd(out io.Writer) *cobra.Command { o := &searchHubOptions{} cmd := &cobra.Command{ - Use: "hub [keyword]", - Short: "search for charts in the Helm Hub or an instance of Monocular", - Long: searchHubDesc, + Use: "hub [keyword]", + DisableFlagsInUseLine: true, + Short: "search for charts in the Helm Hub or an instance of Monocular", + Long: searchHubDesc, RunE: func(cmd *cobra.Command, args []string) error { return o.run(out, args) }, diff --git a/cmd/helm/search_repo.go b/cmd/helm/search_repo.go index c7f0da974..aef0c9f10 100644 --- a/cmd/helm/search_repo.go +++ b/cmd/helm/search_repo.go @@ -79,9 +79,10 @@ func newSearchRepoCmd(out io.Writer) *cobra.Command { o := &searchRepoOptions{} cmd := &cobra.Command{ - Use: "repo [keyword]", - Short: "search repositories for a keyword in charts", - Long: searchRepoDesc, + Use: "repo [keyword]", + DisableFlagsInUseLine: true, + Short: "search repositories for a keyword in charts", + Long: searchRepoDesc, RunE: func(cmd *cobra.Command, args []string) error { o.repoFile = settings.RepositoryConfig o.repoCacheDir = settings.RepositoryCache diff --git a/cmd/helm/show.go b/cmd/helm/show.go index b335c5f76..87a13d7e6 100644 --- a/cmd/helm/show.go +++ b/cmd/helm/show.go @@ -55,11 +55,12 @@ func newShowCmd(out io.Writer) *cobra.Command { client := action.NewShow(action.ShowAll) showCommand := &cobra.Command{ - Use: "show", - Short: "show information of a chart", - Aliases: []string{"inspect"}, - Long: showDesc, - Args: require.NoArgs, + Use: "show", + DisableFlagsInUseLine: true, + Short: "show information of a chart", + Aliases: []string{"inspect"}, + Long: showDesc, + Args: require.NoArgs, } // Function providing dynamic auto-completion @@ -71,10 +72,11 @@ func newShowCmd(out io.Writer) *cobra.Command { } all := &cobra.Command{ - Use: "all [CHART]", - Short: "show all information of the chart", - Long: showAllDesc, - Args: require.ExactArgs(1), + Use: "all [CHART]", + DisableFlagsInUseLine: true, + Short: "show all information of the chart", + Long: showAllDesc, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client.OutputFormat = action.ShowAll output, err := runShow(args, client) @@ -87,10 +89,11 @@ func newShowCmd(out io.Writer) *cobra.Command { } valuesSubCmd := &cobra.Command{ - Use: "values [CHART]", - Short: "show the chart's values", - Long: showValuesDesc, - Args: require.ExactArgs(1), + Use: "values [CHART]", + DisableFlagsInUseLine: true, + Short: "show the chart's values", + Long: showValuesDesc, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client.OutputFormat = action.ShowValues output, err := runShow(args, client) @@ -103,10 +106,11 @@ func newShowCmd(out io.Writer) *cobra.Command { } chartSubCmd := &cobra.Command{ - Use: "chart [CHART]", - Short: "show the chart's definition", - Long: showChartDesc, - Args: require.ExactArgs(1), + Use: "chart [CHART]", + DisableFlagsInUseLine: true, + Short: "show the chart's definition", + Long: showChartDesc, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client.OutputFormat = action.ShowChart output, err := runShow(args, client) @@ -119,10 +123,11 @@ func newShowCmd(out io.Writer) *cobra.Command { } readmeSubCmd := &cobra.Command{ - Use: "readme [CHART]", - Short: "show the chart's README", - Long: readmeChartDesc, - Args: require.ExactArgs(1), + Use: "readme [CHART]", + DisableFlagsInUseLine: true, + Short: "show the chart's README", + Long: readmeChartDesc, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { client.OutputFormat = action.ShowReadme output, err := runShow(args, client) diff --git a/cmd/helm/status.go b/cmd/helm/status.go index 2efb2006c..e6ba2b4cf 100644 --- a/cmd/helm/status.go +++ b/cmd/helm/status.go @@ -49,10 +49,11 @@ func newStatusCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { var outfmt output.Format cmd := &cobra.Command{ - Use: "status RELEASE_NAME", - Short: "display the status of the named release", - Long: statusHelp, - Args: require.ExactArgs(1), + Use: "status RELEASE_NAME", + DisableFlagsInUseLine: true, + Short: "display the status of the named release", + Long: statusHelp, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { rel, err := client.Run(args[0]) if err != nil { diff --git a/cmd/helm/template.go b/cmd/helm/template.go index a4438b50c..946064475 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -52,10 +52,11 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { var showFiles []string cmd := &cobra.Command{ - Use: "template [NAME] [CHART]", - Short: "locally render templates", - Long: templateDesc, - Args: require.MinimumNArgs(1), + Use: "template [NAME] [CHART]", + DisableFlagsInUseLine: true, + Short: "locally render templates", + Long: templateDesc, + Args: require.MinimumNArgs(1), RunE: func(_ *cobra.Command, args []string) error { client.DryRun = true client.ReleaseName = "RELEASE-NAME" diff --git a/cmd/helm/testdata/output/get-all-no-args.txt b/cmd/helm/testdata/output/get-all-no-args.txt index cc3fc2ad1..23b49ace9 100644 --- a/cmd/helm/testdata/output/get-all-no-args.txt +++ b/cmd/helm/testdata/output/get-all-no-args.txt @@ -1,3 +1,3 @@ Error: "helm get all" requires 1 argument -Usage: helm get all RELEASE_NAME [flags] +Usage: helm get all RELEASE_NAME diff --git a/cmd/helm/testdata/output/get-hooks-no-args.txt b/cmd/helm/testdata/output/get-hooks-no-args.txt index 2911fdb88..a09b25ef9 100644 --- a/cmd/helm/testdata/output/get-hooks-no-args.txt +++ b/cmd/helm/testdata/output/get-hooks-no-args.txt @@ -1,3 +1,3 @@ Error: "helm get hooks" requires 1 argument -Usage: helm get hooks RELEASE_NAME [flags] +Usage: helm get hooks RELEASE_NAME diff --git a/cmd/helm/testdata/output/get-manifest-no-args.txt b/cmd/helm/testdata/output/get-manifest-no-args.txt index df7aa5b04..4913b2199 100644 --- a/cmd/helm/testdata/output/get-manifest-no-args.txt +++ b/cmd/helm/testdata/output/get-manifest-no-args.txt @@ -1,3 +1,3 @@ Error: "helm get manifest" requires 1 argument -Usage: helm get manifest RELEASE_NAME [flags] +Usage: helm get manifest RELEASE_NAME diff --git a/cmd/helm/testdata/output/get-notes-no-args.txt b/cmd/helm/testdata/output/get-notes-no-args.txt index 1a0c20caa..34e31edbe 100644 --- a/cmd/helm/testdata/output/get-notes-no-args.txt +++ b/cmd/helm/testdata/output/get-notes-no-args.txt @@ -1,3 +1,3 @@ Error: "helm get notes" requires 1 argument -Usage: helm get notes RELEASE_NAME [flags] +Usage: helm get notes RELEASE_NAME diff --git a/cmd/helm/testdata/output/get-values-args.txt b/cmd/helm/testdata/output/get-values-args.txt index c8a65e7f3..d1962a169 100644 --- a/cmd/helm/testdata/output/get-values-args.txt +++ b/cmd/helm/testdata/output/get-values-args.txt @@ -1,3 +1,3 @@ Error: "helm get values" requires 1 argument -Usage: helm get values RELEASE_NAME [flags] +Usage: helm get values RELEASE_NAME diff --git a/cmd/helm/testdata/output/install-no-args.txt b/cmd/helm/testdata/output/install-no-args.txt index 47f010ab8..468756f54 100644 --- a/cmd/helm/testdata/output/install-no-args.txt +++ b/cmd/helm/testdata/output/install-no-args.txt @@ -1,3 +1,3 @@ Error: "helm install" requires at least 1 argument -Usage: helm install [NAME] [CHART] [flags] +Usage: helm install [NAME] [CHART] diff --git a/cmd/helm/testdata/output/rollback-no-args.txt b/cmd/helm/testdata/output/rollback-no-args.txt index a1bc30b7a..f3fc7b292 100644 --- a/cmd/helm/testdata/output/rollback-no-args.txt +++ b/cmd/helm/testdata/output/rollback-no-args.txt @@ -1,3 +1,3 @@ Error: "helm rollback" requires at least 1 argument -Usage: helm rollback [REVISION] [flags] +Usage: helm rollback [REVISION] diff --git a/cmd/helm/testdata/output/template-no-args.txt b/cmd/helm/testdata/output/template-no-args.txt index f72f2b8cf..9077b2647 100644 --- a/cmd/helm/testdata/output/template-no-args.txt +++ b/cmd/helm/testdata/output/template-no-args.txt @@ -1,3 +1,3 @@ Error: "helm template" requires at least 1 argument -Usage: helm template [NAME] [CHART] [flags] +Usage: helm template [NAME] [CHART] diff --git a/cmd/helm/testdata/output/uninstall-no-args.txt b/cmd/helm/testdata/output/uninstall-no-args.txt index fc01a75b9..30a9ab172 100644 --- a/cmd/helm/testdata/output/uninstall-no-args.txt +++ b/cmd/helm/testdata/output/uninstall-no-args.txt @@ -1,3 +1,3 @@ Error: "helm uninstall" requires at least 1 argument -Usage: helm uninstall RELEASE_NAME [...] [flags] +Usage: helm uninstall RELEASE_NAME [...] diff --git a/cmd/helm/uninstall.go b/cmd/helm/uninstall.go index 85fa822bd..2bf1e4489 100644 --- a/cmd/helm/uninstall.go +++ b/cmd/helm/uninstall.go @@ -42,12 +42,13 @@ func newUninstallCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { client := action.NewUninstall(cfg) cmd := &cobra.Command{ - Use: "uninstall RELEASE_NAME [...]", - Aliases: []string{"del", "delete", "un"}, - SuggestFor: []string{"remove", "rm"}, - Short: "uninstall a release", - Long: uninstallDesc, - Args: require.MinimumNArgs(1), + Use: "uninstall RELEASE_NAME [...]", + DisableFlagsInUseLine: true, + Aliases: []string{"del", "delete", "un"}, + SuggestFor: []string{"remove", "rm"}, + Short: "uninstall a release", + Long: uninstallDesc, + Args: require.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { for i := 0; i < len(args); i++ { diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index c263d32e7..c11dbe464 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -68,10 +68,11 @@ func newUpgradeCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { var createNamespace bool cmd := &cobra.Command{ - Use: "upgrade [RELEASE] [CHART]", - Short: "upgrade a release", - Long: upgradeDesc, - Args: require.ExactArgs(2), + Use: "upgrade [RELEASE] [CHART]", + DisableFlagsInUseLine: true, + Short: "upgrade a release", + Long: upgradeDesc, + Args: require.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { client.Namespace = settings.Namespace() diff --git a/cmd/helm/verify.go b/cmd/helm/verify.go index f26fb377f..24a9a0863 100644 --- a/cmd/helm/verify.go +++ b/cmd/helm/verify.go @@ -40,10 +40,11 @@ func newVerifyCmd(out io.Writer) *cobra.Command { client := action.NewVerify() cmd := &cobra.Command{ - Use: "verify PATH", - Short: "verify that a chart at the given path has been signed and is valid", - Long: verifyDesc, - Args: require.ExactArgs(1), + Use: "verify PATH", + DisableFlagsInUseLine: true, + Short: "verify that a chart at the given path has been signed and is valid", + Long: verifyDesc, + Args: require.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { err := client.Run(args[0]) if err != nil { diff --git a/cmd/helm/verify_test.go b/cmd/helm/verify_test.go index ccbcb3cf2..29d91175a 100644 --- a/cmd/helm/verify_test.go +++ b/cmd/helm/verify_test.go @@ -41,7 +41,7 @@ func TestVerifyCmd(t *testing.T) { { name: "verify requires a chart", cmd: "verify", - expect: "\"helm verify\" requires 1 argument\n\nUsage: helm verify PATH [flags]", + expect: "\"helm verify\" requires 1 argument\n\nUsage: helm verify PATH", wantError: true, }, { diff --git a/cmd/helm/version.go b/cmd/helm/version.go index b3f831e07..e5ca61d33 100644 --- a/cmd/helm/version.go +++ b/cmd/helm/version.go @@ -58,10 +58,11 @@ func newVersionCmd(out io.Writer) *cobra.Command { o := &versionOptions{} cmd := &cobra.Command{ - Use: "version", - Short: "print the client version information", - Long: versionDesc, - Args: require.NoArgs, + Use: "version", + DisableFlagsInUseLine: true, + Short: "print the client version information", + Long: versionDesc, + Args: require.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return o.run(out) },