From 3984919a3df95b8ec203bcb82b66c9c2270579c7 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 12 Oct 2019 18:10:44 +0900 Subject: bridge: various cleanups --- misc/zsh_completion/git-bug | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'misc/zsh_completion') diff --git a/misc/zsh_completion/git-bug b/misc/zsh_completion/git-bug index 9951bab9..1f4679ad 100644 --- a/misc/zsh_completion/git-bug +++ b/misc/zsh_completion/git-bug @@ -118,6 +118,7 @@ function _git-bug_bridge { "pull:Pull updates." "push:Push updates." "rm:Delete a configured bridge." + "token:Configure and use bridge tokens." ) _describe "command" commands ;; @@ -136,6 +137,9 @@ function _git-bug_bridge { rm) _git-bug_bridge_rm ;; + token) + _git-bug_bridge_token + ;; esac } @@ -164,6 +168,48 @@ function _git-bug_bridge_rm { _arguments } + +function _git-bug_bridge_token { + local -a commands + + _arguments -C \ + '(-l --local)'{-l,--local}'[]' \ + '(-g --global)'{-g,--global}'[]' \ + "1: :->cmnds" \ + "*::arg:->args" + + case $state in + cmnds) + commands=( + "add:Configure and use bridge tokens." + "rm:Configure and use bridge tokens." + ) + _describe "command" commands + ;; + esac + + case "$words[1]" in + add) + _git-bug_bridge_token_add + ;; + rm) + _git-bug_bridge_token_rm + ;; + esac +} + +function _git-bug_bridge_token_add { + _arguments \ + '(-g --global)'{-g,--global}'[]' \ + '(-v --value)'{-v,--value}'[]:' \ + '(-t --target)'{-t,--target}'[]:' \ + '(*-s *--scopes)'{\*-s,\*--scopes}'[]:' +} + +function _git-bug_bridge_token_rm { + _arguments +} + function _git-bug_commands { _arguments \ '(-p --pretty)'{-p,--pretty}'[Output the command description as well as Markdown compatible comment]' -- cgit