chiark / gitweb /
Merge commit 'refs/top-bases/fixes/more-help' into fixes/more-help
[topgit.git] / contrib / tg-completion.bash
index 0ee233c4781b1fe8d3a84772c59373e30ed2f06f..e34b66f56fb22f50ad6bc1e05524f1a4fe4b4d28 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
@@ -416,14 +434,55 @@ _tg_summary ()
        *)
                __tgcomp "
                        --graphviz
+                       --sort
+                       --deps
                        -t
+                       -i
+                       -w
                "
        esac
 }
 
 _tg_update ()
 {
-       COMPREPLY=()
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+
+       case "$cur" in
+       *)
+               __tgcomp "$(__tg_topics)"
+       esac
+}
+
+_tg_next ()
+{
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+
+       case "$cur" in
+       -*)
+               __tgcomp "
+                       -i
+                       -w
+               "
+               ;;
+       *)
+               __tgcomp "$(__tg_heads)"
+       esac
+}
+
+_tg_prev ()
+{
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+
+       case "$cur" in
+       -*)
+               __tgcomp "
+                       -i
+                       -w
+               "
+               ;;
+       *)
+               __tgcomp "$(__tg_topics)"
+       esac
 }
 
 ### }}}
@@ -467,11 +526,15 @@ _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 ;;
+       next)        _tg_next ;;
        patch)       _tg_patch ;;
+       prev)        _tg_prev ;;
        push)        _tg_push ;;
        remote)      _tg_remote ;;
        summary)     _tg_summary ;;