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=4d69c05e26951307a38070bbd0315af60833dbf5;hb=49b02b3a83f5f17c973b11111a48f8fde1df50b5;hpb=3aec3f8eece2f1f2b6d1df66ce48b060733ff6f8 diff --git a/contrib/tg-completion.bash b/contrib/tg-completion.bash index 4d69c05..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]}" @@ -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 @@ -389,7 +433,12 @@ _tg_summary () _tg_update () { - COMPREPLY=() + local cur="${COMP_WORDS[COMP_CWORD]}" + + case "$cur" in + *) + __tgcomp "$(__tg_topics)" + esac } ### }}} @@ -433,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 ;;