aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucio Sauer <watermanpaint@posteo.net>2024-07-20 17:06:22 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-07-20 18:37:23 +0300
commita44b2704f35bf9b3e3e282dd95e97ffe6b364e04 (patch)
treec285c5b192b1587b1f918f6fac88723156154305
parenttests: add tests for Closes tags with resolution (diff)
downloadpkgdev-a44b2704f35bf9b3e3e282dd95e97ffe6b364e04.tar.gz
pkgdev-a44b2704f35bf9b3e3e282dd95e97ffe6b364e04.tar.bz2
pkgdev-a44b2704f35bf9b3e3e282dd95e97ffe6b364e04.zip
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>
-rw-r--r--data/share/bash-completion/completions/pkgdev20
1 files changed, 18 insertions, 2 deletions
diff --git a/data/share/bash-completion/completions/pkgdev b/data/share/bash-completion/completions/pkgdev
index 17eb34c..3631d64 100644
--- a/data/share/bash-completion/completions/pkgdev
+++ b/data/share/bash-completion/completions/pkgdev
@@ -4,7 +4,7 @@ source "/usr/share/bash-completion/helpers/gentoo-common.sh"
_pkgdev() {
local i=1 cmd cur prev words cword split
- _init_completion || return
+ _init_completion -n : || return
local subcommands="
bugs
@@ -79,7 +79,23 @@ _pkgdev() {
"
case "${prev}" in
- -[bcTm] | --bug | --closes | --tag | --message)
+ -c | --closes)
+ local resolutions=(
+ fixed
+ obsolete
+ pkgremoved
+ )
+
+ local bug="${cur%:*}"
+ if [[ ${bug} != ${cur} && ${bug} != http?(s) ]]; then
+ local bugres="${resolutions[*]/#/${bug}:}"
+ COMPREPLY=($(compgen -W "${bugres}" -- "${cur}"))
+ _comp_ltrim_colon_completions "$cur"
+ else
+ COMPREPLY=()
+ fi
+ ;;
+ -[bTm] | --bug | --tag | --message)
COMPREPLY=()
;;
-M | --message-template)