diff --git a/bash_completions.md b/bash_completions.md index 8d01f456..23464e13 100644 --- a/bash_completions.md +++ b/bash_completions.md @@ -144,6 +144,17 @@ and you'll get something like -c --container= -p --pod= ``` +## Hide commands from completion + +If you don't want a command to show up in completion you can mark it as `Hidden`. + +```go +cmd := &cobra.Command{ + ... + Hidden: true, +} +``` + # Specify valid filename extensions for flags that take a filename In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions.