Skip to content

Commit e00c119

Browse files
committed
g*: Support completing arg of last bundled short option
1 parent c1dfa0f commit e00c119

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

completions/getent

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ _getent()
88
local i db
99
for (( i=1; i < cword; i++ )); do
1010
case ${words[i]} in
11-
-V|--version|--usage|-'?'|--help)
11+
--version|--usage|--help|-!(-*)[V?])
1212
return
1313
;;
14-
-s|--service)
14+
--service|-!(-*)s)
1515
(( i++ ))
1616
;;
1717
-*)

completions/gpasswd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _gpasswd()
66
_init_completion || return
77

88
case $prev in
9-
-a|--add|-d|--delete|-A|--administrators|-M|--members)
9+
--add|--delete|--administrators|--members|-!(-*)[adAM])
1010
COMPREPLY=( $( compgen -u -- "$cur" ) )
1111
return
1212
;;

completions/gpg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _gpg()
66
_init_completion || return
77

88
case $prev in
9-
-s|--sign|--clearsign|--decrypt-files|--load-extension)
9+
--sign|--clearsign|--decrypt-files|--load-extension|-!(-*)s)
1010
_filedir
1111
return
1212
;;
@@ -17,7 +17,7 @@ _gpg()
1717
's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) )
1818
return
1919
;;
20-
-r|--recipient)
20+
--recipient|-!(-*)r)
2121
COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \
2222
's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) )
2323
if [[ -e ~/.gnupg/gpg.conf ]]; then

completions/gpg2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ _gpg2()
1010
_filedir -d
1111
return
1212
;;
13-
-s|--sign|--clearsign|--options|--decrypt)
13+
--sign|--clearsign|--options|--decrypt|-!(-*)s)
1414
_filedir
1515
return
1616
;;
@@ -21,7 +21,7 @@ _gpg2()
2121
's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) )
2222
return
2323
;;
24-
-r|--recipient)
24+
--recipient|-!(-*)r)
2525
COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \
2626
command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) )
2727
if [[ -e ~/.gnupg/gpg.conf ]]; then

completions/groupadd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _groupadd()
99
# with -g/--gid
1010

1111
case $prev in
12-
-g|--gid|-K|--key|-p|--password)
12+
--gid|--key|--password|-!(-*)[gKp])
1313
return
1414
;;
1515
esac

completions/groupmod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _groupmod()
99
# with -g/--gid
1010

1111
case $prev in
12-
-g|--gid|-h|--help|-n|--new-name|-p|--password)
12+
--gid|--help|--new-name|--password|-!(-*)[ghnp])
1313
return
1414
;;
1515
esac

completions/gzip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ _gzip()
66
_init_completion || return
77

88
case $prev in
9-
-b|--blocksize|-S|--suffix|-h|--help|-V|--version)
9+
--blocksize|--suffix|--help|--version|-!(-*)[bShV])
1010
return
1111
;;
12-
-p|--processes)
12+
--processes|-!(-*)p)
1313
COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) )
1414
return
1515
;;

0 commit comments

Comments
 (0)