From a281c8b47b315fe428cf31ad5c38b526dc136f55 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 16 Sep 2022 16:44:28 -0400 Subject: [PATCH] Document option to hide the default completion cmd (#1779) Signed-off-by: Marc Khouzam 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 1e2058ed..a0957b4d 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