We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_comp_compgen -P
*%*
1 parent 54b0fa2 commit 21d1c64Copy full SHA for 21d1c64
completions/upgradepkg
@@ -10,13 +10,11 @@ _comp_cmd_upgradepkg()
10
return
11
fi
12
13
- if [[ $cur == ?*%* ]]; then
14
- prev="${cur%%?(\\)%*}"
15
- cur="${cur#*%}"
16
- local nofiles=""
+ if [[ $cur =~ ^[^%]+% ]]; then
+ local prefix=$BASH_REMATCH nofiles=""
17
compopt -o filenames
18
- _comp_compgen -- -P "$prev%" -f -X "!*.t[bgxl]z" || nofiles=set
19
- _comp_compgen -a -- -P "$prev%" -S '/' -d
+ _comp_compgen -P "$prefix" -- -f -X "!*.t[bgxl]z" || nofiles=set
+ _comp_compgen -aP "$prefix" -- -S '/' -d
20
[[ $nofiles ]] && compopt -o nospace
21
22
0 commit comments