Merge pull request #1475 from hongyi-zhao/master
Fix the completion for pip/pip3
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user