pyenv/completions/rbenv.bash

17 lines
410 B
Bash
Raw Normal View History

2011-08-03 21:44:29 -04:00
_rbenv() {
COMPREPLY=()
2011-09-13 11:13:27 -04:00
local word="${COMP_WORDS[COMP_CWORD]}"
if [ "$COMP_CWORD" -eq 1 ]; then
COMPREPLY=( $(compgen -W "$(rbenv commands)" -- "$word") )
else
local words=("${COMP_WORDS[@]}")
unset "words[0]"
unset "words[$COMP_CWORD]"
local completions=$(rbenv completions "${words[@]}")
2011-09-13 11:13:27 -04:00
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
fi
}
complete -F _rbenv rbenv