You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
406 B

  1. _pyenv() {
  2. COMPREPLY=()
  3. local word="${COMP_WORDS[COMP_CWORD]}"
  4. if [ "$COMP_CWORD" -eq 1 ]; then
  5. COMPREPLY=( $(compgen -W "$(pyenv commands)" -- "$word") )
  6. else
  7. local words=("${COMP_WORDS[@]}")
  8. unset words[0]
  9. unset words[$COMP_CWORD]
  10. local completions=$(pyenv completions "${words[@]}")
  11. COMPREPLY=( $(compgen -W "$completions" -- "$word") )
  12. fi
  13. }
  14. complete -F _pyenv pyenv