File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed
src/pip/_internal/commands Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change
1
+ Fix completion script for zsh
Original file line number Diff line number Diff line change 23
23
""" ,
24
24
"zsh" : """
25
25
#compdef -P pip[0-9.]#
26
- compadd $( COMP_WORDS="$words[*]" \\
27
- COMP_CWORD=$((CURRENT-1)) \\
28
- PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
26
+ __pip() {{
27
+ compadd $( COMP_WORDS="$words[*]" \\
28
+ COMP_CWORD=$((CURRENT-1)) \\
29
+ PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
30
+ }}
31
+ if [[ $zsh_eval_context[-1] == loadautofunc ]]; then
32
+ # autoload from fpath, call function directly
33
+ __pip "$@"
34
+ else
35
+ # eval/source/. command, register function for later
36
+ compdef __pip -P 'pip[0-9.]#'
37
+ fi
29
38
""" ,
30
39
"fish" : """
31
40
function __fish_complete_pip
Original file line number Diff line number Diff line change 44
44
"zsh" ,
45
45
"""\
46
46
#compdef -P pip[0-9.]#
47
- compadd $( COMP_WORDS="$words[*]" \\
48
- COMP_CWORD=$((CURRENT-1)) \\
49
- PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )""" ,
47
+ __pip() {
48
+ compadd $( COMP_WORDS="$words[*]" \\
49
+ COMP_CWORD=$((CURRENT-1)) \\
50
+ PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null )
51
+ }
52
+ if [[ $zsh_eval_context[-1] == loadautofunc ]]; then
53
+ # autoload from fpath, call function directly
54
+ __pip "$@"
55
+ else
56
+ # eval/source/. command, register function for later
57
+ compdef __pip -P 'pip[0-9.]#'
58
+ fi""" ,
50
59
),
51
60
(
52
61
"powershell" ,
You can’t perform that action at this time.
0 commit comments