diff --git a/completion/available/pip.completion.bash b/completion/available/pip.completion.bash index 7ed8c17e..a20df4cd 100644 --- a/completion/available/pip.completion.bash +++ b/completion/available/pip.completion.bash @@ -7,5 +7,13 @@ # you should first initialize the corresponding environment. # So that pip is in the system's path. if _command_exists pip; then - eval "$(pip completion --bash)" + function __bash_it_complete_pip() { + if _command_exists _pip_completion; then + _pip_completion "$@" + else + eval "$(pip completion --bash)" + _pip_completion "$@" + fi + } + complete -o default -F __bash_it_complete_pip pip fi diff --git a/completion/available/pip3.completion.bash b/completion/available/pip3.completion.bash index c2b58564..d69460a5 100644 --- a/completion/available/pip3.completion.bash +++ b/completion/available/pip3.completion.bash @@ -7,5 +7,13 @@ # you should first initialize the corresponding environment. # So that pip3 is in the system's path. if _command_exists pip3; then - eval "$(pip3 completion --bash)" + function __bash_it_complete_pip3() { + if _command_exists _pip_completion; then + _pip_completion "$@" + else + eval "$(pip3 completion --bash)" + _pip_completion "$@" + fi + } + complete -o default -F __bash_it_complete_pip3 pip3 fi