mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-23 17:03:14 +00:00
16 lines
406 B
Bash
16 lines
406 B
Bash
_pyenv() {
|
|
COMPREPLY=()
|
|
local word="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
if [ "$COMP_CWORD" -eq 1 ]; then
|
|
COMPREPLY=( $(compgen -W "$(pyenv commands)" -- "$word") )
|
|
else
|
|
local words=("${COMP_WORDS[@]}")
|
|
unset words[0]
|
|
unset words[$COMP_CWORD]
|
|
local completions=$(pyenv completions "${words[@]}")
|
|
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
|
fi
|
|
}
|
|
|
|
complete -F _pyenv pyenv
|