mirror of https://github.com/pypa/pip
Fix zsh completion script (#12173)
This commit is contained in:
commit
9b7348269b
|
@ -0,0 +1 @@
|
||||||
|
Fix completion script for zsh
|
|
@ -23,9 +23,18 @@ COMPLETION_SCRIPTS = {
|
||||||
""",
|
""",
|
||||||
"zsh": """
|
"zsh": """
|
||||||
#compdef -P pip[0-9.]#
|
#compdef -P pip[0-9.]#
|
||||||
compadd $( COMP_WORDS="$words[*]" \\
|
__pip() {{
|
||||||
COMP_CWORD=$((CURRENT-1)) \\
|
compadd $( COMP_WORDS="$words[*]" \\
|
||||||
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
|
COMP_CWORD=$((CURRENT-1)) \\
|
||||||
|
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
|
||||||
|
}}
|
||||||
|
if [[ $zsh_eval_context[-1] == loadautofunc ]]; then
|
||||||
|
# autoload from fpath, call function directly
|
||||||
|
__pip "$@"
|
||||||
|
else
|
||||||
|
# eval/source/. command, register function for later
|
||||||
|
compdef __pip -P 'pip[0-9.]#'
|
||||||
|
fi
|
||||||
""",
|
""",
|
||||||
"fish": """
|
"fish": """
|
||||||
function __fish_complete_pip
|
function __fish_complete_pip
|
||||||
|
|
|
@ -44,9 +44,18 @@ complete -fa "(__fish_complete_pip)" -c pip""",
|
||||||
"zsh",
|
"zsh",
|
||||||
"""\
|
"""\
|
||||||
#compdef -P pip[0-9.]#
|
#compdef -P pip[0-9.]#
|
||||||
compadd $( COMP_WORDS="$words[*]" \\
|
__pip() {
|
||||||
COMP_CWORD=$((CURRENT-1)) \\
|
compadd $( COMP_WORDS="$words[*]" \\
|
||||||
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )""",
|
COMP_CWORD=$((CURRENT-1)) \\
|
||||||
|
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
|
||||||
|
}
|
||||||
|
if [[ $zsh_eval_context[-1] == loadautofunc ]]; then
|
||||||
|
# autoload from fpath, call function directly
|
||||||
|
__pip "$@"
|
||||||
|
else
|
||||||
|
# eval/source/. command, register function for later
|
||||||
|
compdef __pip -P 'pip[0-9.]#'
|
||||||
|
fi""",
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"powershell",
|
"powershell",
|
||||||
|
|
Loading…
Reference in New Issue