- tests expected results indendation was off
- add bugfix news entry
This commit is contained in:
Wu Zhenyu 2023-07-22 15:31:12 +08:00 committed by wzy
parent b551c09c4e
commit dba399fe6a
3 changed files with 25 additions and 6 deletions

1
news/12166.bugfix.rst Normal file
View File

@ -0,0 +1 @@
Fix completion script for zsh

View File

@ -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

View File

@ -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",