We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a command to generate completions for a CLI. Possible example usage:
$ sub --name awesomecli --bin bin/awesomecli --relative ".." gen-completions zsh > completions/awesomecli.zsh
Possible template for zsh (using old completions system):
if [[ ! -o interactive ]]; then return fi compctl -K _awesomecli awesomecli _awesomecli() { local words completions read -cA words if [ "${#words}" -eq 2 ]; then completions="$(awesomecli completions)" else completions="$(awesomecli completions "${words[@]:1:-1}")" fi reply=("${(ps:\n:)completions}") }
and bash:
_awesomecli() { COMPREPLY=() local word="${COMP_WORDS[COMP_CWORD]}" if [ "$COMP_CWORD" -eq 1 ]; then COMPREPLY=( $(compgen -W "$(awesomecli completions)" -- "$word") ) else local completions="$(awesomecli completions "${COMP_WORDS[@]:1}")" COMPREPLY=( $(compgen -W "$completions" -- "$word") ) fi } complete -F _awesomecli awesomecli
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Provide a command to generate completions for a CLI. Possible example usage:
Possible template for zsh (using old completions system):
and bash:
The text was updated successfully, but these errors were encountered: