Skip to content

Commit 2998932

Browse files
committed
bash-completion: support for short option group
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent cb3968c commit 2998932

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • data/share/bash-completion/completions

data/share/bash-completion/completions/pkgdev

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ _pkgdev() {
66
local i=1 cmd cur prev words cword split
77
_comp_initialize -n : "$@" || return
88

9+
# If the previous word looks like a group of short options,
10+
# handle it as if it were just the last short option.
11+
# e.g. "-qr" -> "-r"
12+
if [[ ${prev} =~ ^-[a-zA-Z]{2,}$ ]]; then
13+
prev="-${prev:(-1)}"
14+
fi
15+
916
local subcommands="
1017
bugs
1118
commit

0 commit comments

Comments
 (0)