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

View File

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