mirror of
https://github.com/rbenv/rbenv.git
synced 2024-12-28 04:35:21 +01:00
16 lines
410 B
Bash
16 lines
410 B
Bash
_rbenv() {
|
|
COMPREPLY=()
|
|
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[@]}")
|
|
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
|
fi
|
|
}
|
|
|
|
complete -F _rbenv rbenv
|