File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ func Execute(app *cobra.Command) {
2121 // hide the default "completion" subcommand from polluting UX (it can still be used). https://github.com/spf13/cobra/issues/1507
2222 app .CompletionOptions = cobra.CompletionOptions {HiddenDefaultCmd : true }
2323
24+ // disable alternate `help <command>` route from polluting UX.
25+ // the de facto `--help` can still be used and pro-tip for that is prominently visible.
26+ // https://github.com/spf13/cobra/issues/587#issuecomment-843747825
27+ app .SetHelpCommand (& cobra.Command {Hidden : true })
28+
2429 // cannot `AddLogLevelControls(app.Flags())` here because it gets confusing if:
2530 // a) the root command is not runnable
2631 // b) the root command is runnable BUT it doesn't do logging (or there is no debug-level logs to suppress)
You can’t perform that action at this time.
0 commit comments