completion writes a script for Bash, Zsh, Fish, or PowerShell to standard
output; diagnostics go to standard error. Choose the shell you actually use,
then save or load the result according to that shell's completion setup.
rootform completion <shell> [options]rootform completion bash > rootform.bashrootform completion zsh > _rootformrootform completion fish > rootform.fishrootform completion powershell > rootform.ps1These examples write files in the current directory. To activate completion in the current shell and load it in future shells, use the commands for your shell below.
Cobra's generated Bash script uses helpers from bash-completion. Load that
package before loading the generated Rootform script.
source ./rootform.bashInitialize Zsh completions before loading Rootform's script:
autoload -Uz compinitcompinitsource ./_rootformsource ./rootform.fish. ./rootform.ps1For future shells, move the generated file to a stable completion directory
and source its absolute path from ~/.bashrc, ~/.zshrc,
~/.config/fish/config.fish, or your PowerShell profile. Initialize
bash-completion or compinit before loading Rootform where required.
Status 0 means the completion script was generated, 2 means the command
was used incorrectly, and 4 means the completion script could not be
written. Use
rootform version to identify the executable providing the
completion script.