-PY_VERSIONS="2,2.7,3,"
+PY_VERSIONS=",2,2.7,3,"
PY_VERSIONS+="$(eval echo 3.{`seq -s, 4 12`} | sed 's/ /,/g')"
-eval delegate_completion python python{$PY_VERSIONS}
+eval delegate_completion python{$PY_VERSIONS}
_pip_completion_loader() {
if [ "`type -t _pip_completion`" != function ]; then
- eval "`pip3 completion --bash`"
+ for pip in `eval type -fP pip{3,2,}`; do break; done
+ eval "`$pip completion --bash`"
fi
- eval complete -F _pip_completion pip pip{$PY_VERSIONS}
+ eval complete -F _pip_completion pip{$PY_VERSIONS}
unset _pip_completion_loader PY_VERSIONS
return 124
}
-eval complete -F _pip_completion_loader pip pip{$PY_VERSIONS}
+eval complete -F _pip_completion_loader pip{$PY_VERSIONS}