diff --git a/completions/rbenv.bash b/completions/rbenv.bash index e327601..fe0784a 100644 --- a/completions/rbenv.bash +++ b/completions/rbenv.bash @@ -5,8 +5,10 @@ _rbenv() { if [ "$COMP_CWORD" -eq 1 ]; then COMPREPLY=( $(compgen -W "$(rbenv commands)" -- "$word") ) else - local command="${COMP_WORDS[1]}" - local completions="$(rbenv completions "$command")" + local words=("${COMP_WORDS[@]}") + unset words[0] + unset words[$COMP_CWORD] + local completions=$(rbenv completions "${words[@]}") COMPREPLY=( $(compgen -W "$completions" -- "$word") ) fi }