2011-08-03 20:44:29 -05:00
|
|
|
_rbenv() {
|
|
|
|
|
COMPREPLY=()
|
2011-09-13 10:13:27 -05:00
|
|
|
local word="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
|
|
|
|
|
|
if [ "$COMP_CWORD" -eq 1 ]; then
|
|
|
|
|
COMPREPLY=( $(compgen -W "$(rbenv commands)" -- "$word") )
|
|
|
|
|
else
|
2012-10-05 04:28:25 +02:00
|
|
|
local words=("${COMP_WORDS[@]}")
|
2020-05-26 22:31:38 +03:00
|
|
|
unset "words[0]"
|
|
|
|
|
unset "words[$COMP_CWORD]"
|
2012-10-05 04:28:25 +02:00
|
|
|
local completions=$(rbenv completions "${words[@]}")
|
2011-09-13 10:13:27 -05:00
|
|
|
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
|
|
|
|
fi
|
2011-08-03 20:41:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
complete -F _rbenv rbenv
|