X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=blobdiff_plain;f=contrib%2Ftg-completion.bash;h=48e47c7047c3c7308cd10b5a0327a63e94cd6fb1;hp=59fbc5065475bdb0241e73945f022196c9a0fc4f;hb=49b02b3a83f5f17c973b11111a48f8fde1df50b5;hpb=7b7ec06945024ed99181fac2b88f8fe44eb5a6f8 diff --git a/contrib/tg-completion.bash b/contrib/tg-completion.bash index 59fbc50..48e47c7 100755 --- a/contrib/tg-completion.bash +++ b/contrib/tg-completion.bash @@ -191,7 +191,7 @@ __tg_complete_revlist () __tg_topics () { - tg summary | cut -f 2 + tg summary -t } __tg_commands () @@ -344,6 +344,16 @@ _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]}" @@ -359,6 +369,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 +408,11 @@ _tg_remote () local cur="${COMP_WORDS[COMP_CWORD]}" case "$cur" in + -*) + __tgcomp " + --populate + " + ;; *) __tgcomp "$(__tg_remotes)" esac @@ -376,12 +420,25 @@ _tg_remote () _tg_summary () { - COMPREPLY=() + local cur="${COMP_WORDS[COMP_CWORD]}" + + case "$cur" in + *) + __tgcomp " + --graphviz + -t + " + esac } _tg_update () { - COMPREPLY=() + local cur="${COMP_WORDS[COMP_CWORD]}" + + case "$cur" in + *) + __tgcomp "$(__tg_topics)" + esac } ### }}} @@ -425,11 +482,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 ;;