Skip to content

Commit c1dfa0f

Browse files
committed
f*: Support completing arg of last bundled short option
1 parent 008a407 commit c1dfa0f

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

completions/faillog

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

88
case $prev in
9-
-h|--help|-l|--lock-time|-m|--maximum|-t|--time)
9+
--help|--lock-time|--maximum|--time|-!(-*)[hlmt])
1010
return
1111
;;
12-
-u|--user)
12+
--user|-!(-*)u)
1313
COMPREPLY=( $( compgen -u -- "$cur" ) )
1414
return
1515
;;

completions/feh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ _feh()
66
_init_completion -s || return
77

88
case "$prev" in
9-
-B|--image-bg)
9+
--image-bg|-B)
1010
COMPREPLY=( $( compgen -W 'checks white black' -- "$cur" ) )
1111
return
1212
;;
13-
-f|--filelist|-o|--output|-O|--output-only|-\||--start-at)
13+
--filelist|--output|--output-only|--start-at|-!(-*)[foO\|])
1414
_filedir
1515
return
1616
;;
17-
-K|--caption-path|-C|--fontpath|-j|--output-dir)
17+
--caption-path|--fontpath|--output-dir|-!(-*)[KCj])
1818
_filedir -d
1919
return
2020
;;
21-
-e|--font|-M|--menu-font|-@|--title-font)
21+
--font|--menu-font|--title-font|-!(-*)[eM@])
2222
# expect string like "dejavu.ttf/12"
2323
if [[ "$cur" == */* ]]; then # expect integer value
2424
COMPREPLY=( $( compgen -P "$cur" -W '{0..9}' ) )
@@ -39,7 +39,7 @@ _feh()
3939
compopt -o nospace
4040
return
4141
;;
42-
-T|--theme)
42+
--theme|-!(-*)T)
4343
local conf_path=~/.config/feh/themes
4444
local theme_name theme_opts
4545
[[ -r $conf_path ]] || return
@@ -51,13 +51,13 @@ _feh()
5151
done < "$conf_path"
5252
return
5353
;;
54-
-S|--sort)
54+
--sort|-!(-*)S)
5555
COMPREPLY=( $( compgen -W 'name filename mtime width height
5656
pixels size format' -- "$cur" ) )
5757
return
5858
;;
59-
-R|--reload|-H|--limit-height|-W|--limit-width|-E|--thumb-height|\
60-
-y|--thumb-width|-J|--thumb-redraw|--magick-timeout)
59+
--reload|--limit-height|--limit-width|--thumb-height|--thumb-width|\
60+
--thumb-redraw|--magick-timeout|-!(-*)[RHWEyJ])
6161
# expect integer value
6262
COMPREPLY+=( $( compgen -W '{0..9}' ) )
6363
compopt -o nospace
@@ -72,16 +72,16 @@ _feh()
7272
fi
7373
return
7474
;;
75-
-a|--alpha)
75+
--alpha|-!(-*)a)
7676
COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) )
7777
return
7878
;;
79-
-b|--bg)
79+
--bg|-!(-*)b)
8080
_filedir
8181
COMPREPLY+=( $( compgen -W 'trans' -- "$cur" ) )
8282
return
8383
;;
84-
-g|--geometry|--max-dimension|--min-dimension)
84+
--geometry|--max-dimension|--min-dimension|-!(-*)g)
8585
# expect string like 640x480
8686
if [[ $cur && "$cur" != *x* ]]; then
8787
COMPREPLY=( x )
@@ -90,8 +90,8 @@ _feh()
9090
compopt -o nospace
9191
return
9292
;;
93-
-L|--customlist|--index-info|--info|-D|--slideshow-delay|-~|\
94-
--thumb-title|-^|--title)
93+
--customlist|--index-info|--info|--slideshow-delay|--thumb-title|\
94+
--title|-!(-*)[LD~^])
9595
# argument required but no completions available
9696
return
9797
;;

completions/file

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ _file()
66
_init_completion || return
77

88
case $prev in
9-
--help|-v|--version|-F|--separator)
9+
--help|--version|--separator|-!(-*)[vF])
1010
return
1111
;;
12-
-m|--magic-file|-f|--files-from)
12+
--magic-file|--files-from|-!(-*)[mf])
1313
_filedir
1414
return
1515
;;
16-
-e|--exclude)
16+
--exclude|-!(-*)e)
1717
COMPREPLY=( $( compgen -W 'apptype ascii cdf compress elf encoding
1818
soft tar text tokens troff' -- "$cur" ) )
1919
return

completions/file-roller

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ _file_roller()
88
local exts='@(7z|ace|alz|ar|arj|[bglx]z|bz2|tb?(z)2|cab|cb[rz]|iso?(9660)|Z|t[abglx]z|cpio|deb|rar|?(g)tar|gem|lh[az]|lz[4h]|?(t)lrz|lzma|lzo|wim|swm|rpm|sit|zoo)'
99

1010
case $prev in
11-
-'?'|--help|--help-all|--help-gtk|--help-sm-client)
11+
--help|--help-all|--help-gtk|--help-sm-client|-!(-*)'?')
1212
return
1313
;;
1414
--sm-client-state-file)
1515
_filedir
1616
return
1717
;;
18-
-a|--add-to)
18+
--add-to|-!(-*)a)
1919
_filedir_xspec unzip
2020
_filedir "$exts"
2121
return
2222
;;
23-
-e|--extract-to|--default-dir)
23+
--extract-to|--default-dir|-!(-*)e)
2424
_filedir -d
2525
return
2626
;;

completions/flake8

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

88
case $prev in
9-
-h|--help|--version)
9+
--help|--version|-!(-*)h)
1010
return
1111
;;
1212
--format)
1313
COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) )
1414
return
1515
;;
16-
-j|--jobs)
16+
--jobs|-!(-*)j)
1717
COMPREPLY=( $( compgen -W "auto {1..$(_ncpus)}" -- "$cur" ) )
1818
return
1919
;;

completions/fusermount

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

88
case $prev in
9-
-h|-V|-o)
9+
-*[hVo])
1010
return
1111
;;
12-
-u)
12+
-*u)
1313
COMPREPLY=( $( compgen -W "$( awk \
1414
'{ if ($3 ~ /^fuse(\.|$)/) print $2 }' /etc/mtab \
1515
2>/dev/null )" -- "$cur" ) )

0 commit comments

Comments
 (0)