-
-
Notifications
You must be signed in to change notification settings - Fork 4
Shell completions
Dominik Gedon edited this page Oct 25, 2021
·
3 revisions
The Cobra library offers a neat built-in command to generate shell completions for bash, fish, powershell and zsh.
The shell completion files can be found unter config/completions/
make build
does include the creation of the shell completions.
./cobbler completion -h
Generate the autocompletion script for cobbler for the specified shell.
See each sub-command's help for details on how to use the generated script.
Usage:
cobbler completion [command]
Available Commands:
bash generate the autocompletion script for bash
fish generate the autocompletion script for fish
powershell generate the autocompletion script for powershell
zsh generate the autocompletion script for zsh
If you are in the root folder of the GitHub project, execute the following command to generate the completions for e.g. zsh:
./cobbler completion zsh > config/completions/zsh/cobbler
Check the file afterwards. There could be some debug/error messages in the first few lines from the CLI output itself which have to be removed.