1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-13 13:53:53 -05:00

Added bash support for completion of full command line

This commit is contained in:
Brian Olsen
2012-10-05 04:28:25 +02:00
parent 6778c8e905
commit 02332d78f3

View File

@@ -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
}