Skip to content

Commit a44b270

Browse files
gonsoosarthurzam
authored andcommitted
bash completion: support Closes tags with resolution
_comp_ltrim_colon_completions was introduced with >=bash-completion-2.12 Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent 3a4a1f3 commit a44b270

File tree

1 file changed

+18
-2
lines changed
  • data/share/bash-completion/completions

1 file changed

+18
-2
lines changed

data/share/bash-completion/completions/pkgdev

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "/usr/share/bash-completion/helpers/gentoo-common.sh"
44

55
_pkgdev() {
66
local i=1 cmd cur prev words cword split
7-
_init_completion || return
7+
_init_completion -n : || return
88

99
local subcommands="
1010
bugs
@@ -79,7 +79,23 @@ _pkgdev() {
7979
"
8080

8181
case "${prev}" in
82-
-[bcTm] | --bug | --closes | --tag | --message)
82+
-c | --closes)
83+
local resolutions=(
84+
fixed
85+
obsolete
86+
pkgremoved
87+
)
88+
89+
local bug="${cur%:*}"
90+
if [[ ${bug} != ${cur} && ${bug} != http?(s) ]]; then
91+
local bugres="${resolutions[*]/#/${bug}:}"
92+
COMPREPLY=($(compgen -W "${bugres}" -- "${cur}"))
93+
_comp_ltrim_colon_completions "$cur"
94+
else
95+
COMPREPLY=()
96+
fi
97+
;;
98+
-[bTm] | --bug | --tag | --message)
8399
COMPREPLY=()
84100
;;
85101
-M | --message-template)

0 commit comments

Comments
 (0)