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=de8a7b55d76bcf5059ed4b979e44efd4aaa9918c;hb=49b02b3a83f5f17c973b11111a48f8fde1df50b5;hpb=2f7cb405238120a51ab113427d25488ef87ef14b diff --git a/contrib/tg-completion.bash b/contrib/tg-completion.bash index de8a7b5..48e47c7 100755 --- a/contrib/tg-completion.bash +++ b/contrib/tg-completion.bash @@ -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]}" @@ -370,6 +380,29 @@ _tg_patch () 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]}" @@ -400,7 +433,12 @@ _tg_summary () _tg_update () { - COMPREPLY=() + local cur="${COMP_WORDS[COMP_CWORD]}" + + case "$cur" in + *) + __tgcomp "$(__tg_topics)" + esac } ### }}} @@ -444,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 ;;