Add proper pyenv support to fish

This commit is contained in:
Colin Powell
2018-12-07 13:40:10 -05:00
parent 574abe6975
commit ce96d464e3
6 changed files with 50 additions and 49 deletions

View File

@ -0,0 +1,16 @@
_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