diff options
author | Guido Günther <agx@sigxcpu.org> | 2015-05-04 09:15:01 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2015-05-04 09:17:17 +0200 |
commit | 270f41b0362f8dde74a406deab32d63f192b6490 (patch) | |
tree | 2d39c2f7811cb061da976ededefd7b094b02fd91 /debian/git-buildpackage.bash-completion | |
parent | 15187ba6f1794629d6550dada242f0d11ad605e1 (diff) |
bash-completion: Drop redundant functions
Due to the previous commit most function are redundant so use a generic
one. This automatically gives us completion support for the *rpm
commands.
Diffstat (limited to 'debian/git-buildpackage.bash-completion')
-rw-r--r-- | debian/git-buildpackage.bash-completion | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/debian/git-buildpackage.bash-completion b/debian/git-buildpackage.bash-completion index e9b3c897..d6991a1b 100644 --- a/debian/git-buildpackage.bash-completion +++ b/debian/git-buildpackage.bash-completion @@ -111,54 +111,13 @@ _gbp-buildpackage() "$cbdist_opts" } -_gbp-dch () -{ - local options=$(_gbp_options dch) - _gbp_comp "$options" -} - -_gbp-import-orig () -{ - local options=$(_gbp_options import-orig) - _gbp_comp "$options" -} - -_gbp-import-dsc () -{ - local options=$(_gbp_options import-dsc) - _gbp_comp "$options" -} - -_gbp-import-dscs () -{ - local options="$(_gbp_options import-dscs) $(_gbp_options import-dsc)" - _gbp_comp "$options" -} -_gbp-pq () +_gbp-generic-cmd() { - local options=$(_gbp_options pq) - options="$options export import rebase drop apply switch" + local options=$(_gbp_options "${1}") _gbp_comp "$options" } -_gbp-pull () -{ - local options=$(_gbp_options pull) - _gbp_comp "$options" -} - -_gbp-clone () -{ - local options=$(_gbp_options clone) - _gbp_comp "$options" -} - -_gbp-create-remote-repo () -{ - local options=$(_gbp_options create-remote-repo) - _gbp_comp "$options" -} have gbp && _gbp () @@ -171,8 +130,11 @@ _gbp () if [ -z "${command}" ]; then COMPREPLY=( $(compgen -W "$commands" -- "${cur}" ) ) else - func=_gbp-"${command}" - $func + if type _gbp-"${command}" >& /dev/null; then + _gbp-"${command}" + else + _gbp-generic-cmd "${command}" + fi fi } [ "${have:-}" ] && complete -F _gbp -o default gbp |