Bash command that queries bash completions.
Makes it possible to use bash completions in any shell (I'm using it for zsh).
- Bash is executed
- Desired completions are loaded
- Bash completion related variables are populated using specified arguments
- Specified bash completion function is called
- Generated completion is printed to STDOUT
USAGE: bash-complete-api [OPTIONS] COMPLETION_FUNCTION COMP_CWORD COMP_POINT COMP_LINE
In human language: function_to_call number_of_words cursor_position current_commandline_contents
OPTIONS: -h|--help Shows this help
-w|--wordbreaks CHARS Sets wordbreaks to CHARS
-s|--source FILE Sources FILE after sourcing /etc/bash_completion
-S|--no-system-completion Do not source /etc/bash_completion
-d|--debug LOGFILE Log to LOGFILE
-- Ends option processing
openstack
does not have a completion for zsh.
This is how I used bash-complete-api
to create zsh completion for openstack
:
#compdef openstack
function _openstack {
compadd -U -- $(bash-complete-api _openstack $((${CURRENT}-1)) $CURSOR "$BUFFER")
}
Feel free to create an issue.