From 535c3fe0d8c2d534386eadce992b4e36b570867f Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 15 Jul 2024 00:49:53 +0300 Subject: [PATCH] .bash_completion.d: Update `python-pip` completion --- .bash_completion.d/python-pip | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.bash_completion.d/python-pip b/.bash_completion.d/python-pip index f6e3126..3f5482f 100644 --- a/.bash_completion.d/python-pip +++ b/.bash_completion.d/python-pip @@ -1,14 +1,15 @@ -PY_VERSIONS="2,2.7,3," +PY_VERSIONS=",2,2.7,3," PY_VERSIONS+="$(eval echo 3.{`seq -s, 4 12`} | sed 's/ /,/g')" -eval delegate_completion python python{$PY_VERSIONS} +eval delegate_completion python{$PY_VERSIONS} _pip_completion_loader() { if [ "`type -t _pip_completion`" != function ]; then - eval "`pip3 completion --bash`" + for pip in `eval type -fP pip{3,2,}`; do break; done + eval "`$pip completion --bash`" fi - eval complete -F _pip_completion pip pip{$PY_VERSIONS} + eval complete -F _pip_completion pip{$PY_VERSIONS} unset _pip_completion_loader PY_VERSIONS return 124 } -eval complete -F _pip_completion_loader pip pip{$PY_VERSIONS} +eval complete -F _pip_completion_loader pip{$PY_VERSIONS} -- 2.39.5