chiark / gitweb /
tg-push: add bash completion
authorBert Wesarg <bert.wesarg@googlemail.com>
Tue, 26 May 2009 23:31:34 +0000 (01:31 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 4 Jun 2009 09:27:12 +0000 (11:27 +0200)
Include all options.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
contrib/tg-completion.bash

index de8a7b55d76bcf5059ed4b979e44efd4aaa9918c..0ee233c4781b1fe8d3a84772c59373e30ed2f06f 100755 (executable)
@@ -370,6 +370,29 @@ _tg_patch ()
        esac
 }
 
        esac
 }
 
+_tg_push ()
+{
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+
+       __tg_complete_arg "-r" && {
+               __tgcomp "$(__tg_remotes)"
+               return
+       }
+
+       case "$cur" in
+       -*)
+               __tgcomp "
+                       --no-deps
+                       --dry-run
+                       --tgish-only
+                       -r
+               "
+               ;;
+       *)
+               __tgcomp "$(__tg_topics)"
+       esac
+}
+
 _tg_remote ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}"
 _tg_remote ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -449,6 +472,7 @@ _tg ()
        info)        _tg_info ;;
        mail)        _tg_mail ;;
        patch)       _tg_patch ;;
        info)        _tg_info ;;
        mail)        _tg_mail ;;
        patch)       _tg_patch ;;
+       push)        _tg_push ;;
        remote)      _tg_remote ;;
        summary)     _tg_summary ;;
        update)      _tg_update ;;
        remote)      _tg_remote ;;
        summary)     _tg_summary ;;
        update)      _tg_update ;;