Add note about hiding a command from completion

This commit is contained in:
Eddie Zaneski 2018-04-11 17:36:54 -04:00
parent cd30c2a7e9
commit 9e57a03052
No known key found for this signature in database
GPG key ID: 10A78D45D5A86448

View file

@ -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.