Configures autocompletion for Tanzu CLI commands.
System command | Primarily used for: Tanzu CLI
Syntax:
tanzu completion SHELL
To enable autocompletion for Bash:
Load only for the current session:
source <(tanzu completion bash)
Load for all new sessions:
tanzu completion bash > $HOME/.config/tanzu/completion.bash.inc
printf "\n# Tanzu shell completion\nsource '$HOME/.config/tanzu/completion.bash.inc'\n" >> $HOME/.bash_profile
To enable autocompletion for Zsh:
Load only for the current session:
autoload -U compinit; compinit
source <(tanzu completion zsh)
compdef _tanzu tanzu
Load for all new sessions:
echo "autoload -U compinit; compinit" >> ~/.zshrc
tanzu completion zsh > "${fpath[1]}/_tanzu"
To enable autocompletion for Fish:
Load only for current session:
tanzu completion fish | source
Load for all new sessions:
tanzu completion fish > ~/.config/fish/completions/tanzu.fish
To enable autocompletion for PowerShell:
Load only for current session:
tanzu completion powershell | Out-String | Invoke-Expression
Load for all new sessions: Add the output of the above command to your PowerShell profile.
-h, --help
Help text.