Merge pull request #1475 from hongyi-zhao/master

Fix the completion for pip/pip3
pull/1479/head
Travis Swicegood 2020-01-15 21:57:13 -06:00 committed by GitHub
commit 83b077bf41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 21 deletions

View File

@ -1,11 +1,10 @@
# pip bash completion start
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip
# pip bash completion end
# https://pip.pypa.io/en/stable/user_guide/#command-completion
# Of course, you should first install the pip, say on Debian:
# sudo apt-get install python-pip
# sudo apt-get install python3-pip
# If the pip package is installed within virtual environments, say, python managed by pyenv,
# you should first initilization the corresponding environment.
# So that the pip/pip3 is in system's path.
if command -v pip >/dev/null; then
eval "$(pip completion --bash)"
fi

View File

@ -1,11 +1,11 @@
# pip bash completion start
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip3
# pip bash completion end
# https://pip.pypa.io/en/stable/user_guide/#command-completion
# Of course, you should first install the pip, say on Debian:
# sudo apt-get install python-pip
# sudo apt-get install python3-pip
# If the pip package is installed within virtual environments, say, python managed by pyenv,
# you should first initilization the corresponding environment.
# So that the pip/pip3 is in system's path.
if command -v pip3 >/dev/null; then
eval "$(pip3 completion --bash)"
fi