mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
import trivial changes from rbenv 0.4.0
This commit is contained in:
@@ -5,8 +5,10 @@ _pyenv() {
|
||||
if [ "$COMP_CWORD" -eq 1 ]; then
|
||||
COMPREPLY=( $(compgen -W "$(pyenv commands)" -- "$word") )
|
||||
else
|
||||
local command="${COMP_WORDS[1]}"
|
||||
local completions="$(pyenv completions "$command")"
|
||||
local words=("${COMP_WORDS[@]}")
|
||||
unset words[0]
|
||||
unset words[$COMP_CWORD]
|
||||
local completions=$(pyenv completions "${words[@]}")
|
||||
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -5,14 +5,13 @@ fi
|
||||
compctl -K _pyenv pyenv
|
||||
|
||||
_pyenv() {
|
||||
local word words completions
|
||||
local words completions
|
||||
read -cA words
|
||||
word="${words[2]}"
|
||||
|
||||
if [ "${#words}" -eq 2 ]; then
|
||||
completions="$(pyenv commands)"
|
||||
else
|
||||
completions="$(pyenv completions "${word}")"
|
||||
completions="$(pyenv completions "${words[2,-1]}")"
|
||||
fi
|
||||
|
||||
reply=("${(ps:\n:)completions}")
|
||||
|
||||
Reference in New Issue
Block a user