From abaa162a749ad1b65393553d50b35298b6148cc2 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Thu, 18 Aug 2022 15:24:40 -0400 Subject: [PATCH] Document option to hide the default completion cmd Signed-off-by: Marc Khouzam --- shell_completions.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell_completions.md b/shell_completions.md index 1e2058ed6..a0957b4d5 100644 --- a/shell_completions.md +++ b/shell_completions.md @@ -99,6 +99,11 @@ To tell Cobra *not* to provide the default `completion` command: rootCmd.CompletionOptions.DisableDefaultCmd = true ``` +To tell Cobra to mark the default `completion` command as *hidden*: +``` +rootCmd.CompletionOptions.HiddenDefaultCmd = true +``` + To tell Cobra *not* to provide the user with the `--no-descriptions` flag to the completion sub-commands: ``` rootCmd.CompletionOptions.DisableNoDescFlag = true