completion: pip: Only invoke pip when trying to complete it
This should greatly reduce shell load time, as the pip invocation takes a lot of timepull/1834/head
parent
db318cdd3e
commit
61c0357414
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue