summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-08-24 11:24:52 +0200
committerGuido Günther <agx@sigxcpu.org>2014-08-24 11:24:52 +0200
commit6d510cedb99249198963d1bc38e56c8c39f14c1f (patch)
treeec6cc21505482579fece65a9da2ceba882898df5 /debian
parent68c053ff469eb48efbbc4f6d20cd6f9cdec9ff3d (diff)
downloadgit-buildpackage-6d510cedb99249198963d1bc38e56c8c39f14c1f.tar.gz
git-buildpackage-6d510cedb99249198963d1bc38e56c8c39f14c1f.tar.bz2
git-buildpackage-6d510cedb99249198963d1bc38e56c8c39f14c1f.zip
bash completion: make command list dynamic
Use "gbp --list-cmds" so we don't have to hardcode the available commands and get support for the RPM ones as they show up.
Diffstat (limited to 'debian')
-rw-r--r--debian/git-buildpackage.bash-completion16
1 files changed, 7 insertions, 9 deletions
diff --git a/debian/git-buildpackage.bash-completion b/debian/git-buildpackage.bash-completion
index c0127041..053b9332 100644
--- a/debian/git-buildpackage.bash-completion
+++ b/debian/git-buildpackage.bash-completion
@@ -27,6 +27,12 @@ _gbp_options ()
}
+_gbp_commands ()
+{
+ gbp --list-cmds | sed -ne 's/^ \+\([a-z\-]\+\) \-.*/\1/p'
+}
+
+
_gbp_comp ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -208,15 +214,7 @@ have gbp &&
_gbp ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
- local commands="buildpackage \
- clone \
- create-remote-repo \
- dch \
- import-dsc \
- import-dscs \
- import-orig \
- pq \
- pull"
+ local commands=$(_gbp_commands)
local func
command=$(_gbp_find_cmd_on_cmdline "$commands")