chiark / gitweb /
tg-mail: accept -i/-w
[topgit.git] / contrib / tg-completion.bash
index 67f820e8d55068697490ac537f27cede4ba46fd2..ddc7655fde13bacd68cc4191a0414839de0c620c 100755 (executable)
@@ -344,11 +344,29 @@ _tg_info ()
        esac
 }
 
+_tg_log ()
+{
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+
+       case "$cur" in
+       *)
+               __tgcomp "$(__tg_topics)"
+       esac
+}
+
 _tg_mail ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}"
 
        case "$cur" in
+       -*)
+               __tgcomp "
+                       -i
+                       -w
+                       -s
+                       -r
+               "
+               ;;
        *)
                __tgcomp "$(__tg_topics)"
        esac
@@ -359,6 +377,35 @@ _tg_patch ()
        local cur="${COMP_WORDS[COMP_CWORD]}"
 
        case "$cur" in
+       -*)
+               __tgcomp "
+                       -i
+                       -w
+               "
+               ;;
+       *)
+               __tgcomp "$(__tg_topics)"
+       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
@@ -369,6 +416,11 @@ _tg_remote ()
        local cur="${COMP_WORDS[COMP_CWORD]}"
 
        case "$cur" in
+       -*)
+               __tgcomp "
+                       --populate
+               "
+               ;;
        *)
                __tgcomp "$(__tg_remotes)"
        esac
@@ -376,12 +428,29 @@ _tg_remote ()
 
 _tg_summary ()
 {
-       COMPREPLY=()
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+
+       case "$cur" in
+       *)
+               __tgcomp "
+                       --graphviz
+                       --sort
+                       --deps
+                       -t
+                       -i
+                       -w
+               "
+       esac
 }
 
 _tg_update ()
 {
-       COMPREPLY=()
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+
+       case "$cur" in
+       *)
+               __tgcomp "$(__tg_topics)"
+       esac
 }
 
 ### }}}
@@ -425,11 +494,14 @@ _tg ()
        delete)      _tg_delete ;;
        depend)      _tg_depend ;;
        export)      _tg_export ;;
+       files)       _tg_patch ;;
        help)        _tg_help ;;
        import)      _tg_import ;;
        info)        _tg_info ;;
+       log)         _tg_log ;;
        mail)        _tg_mail ;;
        patch)       _tg_patch ;;
+       push)        _tg_push ;;
        remote)      _tg_remote ;;
        summary)     _tg_summary ;;
        update)      _tg_update ;;