From e0b15ee7644c20533156850e0be5a07597967450 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 10 Nov 2019 17:32:14 +0100 Subject: cli: rename "token" into "auth" --- misc/zsh_completion/git-bug | 80 ++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'misc/zsh_completion') diff --git a/misc/zsh_completion/git-bug b/misc/zsh_completion/git-bug index f0ff7edf..230061dd 100644 --- a/misc/zsh_completion/git-bug +++ b/misc/zsh_completion/git-bug @@ -114,17 +114,20 @@ function _git-bug_bridge { case $state in cmnds) commands=( + "auth:List all known bridge authentication credentials." "configure:Configure a new bridge." "pull:Pull updates." "push:Push updates." "rm:Delete a configured bridge." - "token:List all known tokens." ) _describe "command" commands ;; esac case "$words[1]" in + auth) + _git-bug_bridge_auth + ;; configure) _git-bug_bridge_configure ;; @@ -137,39 +140,11 @@ function _git-bug_bridge { rm) _git-bug_bridge_rm ;; - token) - _git-bug_bridge_token - ;; esac } -function _git-bug_bridge_configure { - _arguments \ - '(-n --name)'{-n,--name}'[A distinctive name to identify the bridge]:' \ - '(-t --target)'{-t,--target}'[The target of the bridge. Valid values are [github,gitlab,launchpad-preview]]:' \ - '(-u --url)'{-u,--url}'[The URL of the target repository]:' \ - '(-o --owner)'{-o,--owner}'[The owner of the target repository]:' \ - '(-T --token)'{-T,--token}'[The authentication token for the API]:' \ - '--token-stdin[Will read the token from stdin and ignore --token]' \ - '(-p --project)'{-p,--project}'[The name of the target repository]:' -} - -function _git-bug_bridge_pull { - _arguments \ - '(-n --no-resume)'{-n,--no-resume}'[force importing all bugs]' \ - '(-s --since)'{-s,--since}'[import only bugs updated after the given date (ex: "200h" or "june 2 2019")]:' -} - -function _git-bug_bridge_push { - _arguments -} - -function _git-bug_bridge_rm { - _arguments -} - -function _git-bug_bridge_token { +function _git-bug_bridge_auth { local -a commands _arguments -C \ @@ -179,37 +154,62 @@ function _git-bug_bridge_token { case $state in cmnds) commands=( - "add:Store a new token" - "rm:Remove a token." - "show:Display a token." + "add-token:Store a new token" + "rm:Remove a credential." + "show:Display an authentication credential." ) _describe "command" commands ;; esac case "$words[1]" in - add) - _git-bug_bridge_token_add + add-token) + _git-bug_bridge_auth_add-token ;; rm) - _git-bug_bridge_token_rm + _git-bug_bridge_auth_rm ;; show) - _git-bug_bridge_token_show + _git-bug_bridge_auth_show ;; esac } -function _git-bug_bridge_token_add { +function _git-bug_bridge_auth_add-token { _arguments \ '(-t --target)'{-t,--target}'[The target of the bridge. Valid values are [github,gitlab,launchpad-preview]]:' } -function _git-bug_bridge_token_rm { +function _git-bug_bridge_auth_rm { + _arguments +} + +function _git-bug_bridge_auth_show { + _arguments +} + +function _git-bug_bridge_configure { + _arguments \ + '(-n --name)'{-n,--name}'[A distinctive name to identify the bridge]:' \ + '(-t --target)'{-t,--target}'[The target of the bridge. Valid values are [github,gitlab,launchpad-preview]]:' \ + '(-u --url)'{-u,--url}'[The URL of the target repository]:' \ + '(-o --owner)'{-o,--owner}'[The owner of the target repository]:' \ + '(-T --token)'{-T,--token}'[The authentication token for the API]:' \ + '--token-stdin[Will read the token from stdin and ignore --token]' \ + '(-p --project)'{-p,--project}'[The name of the target repository]:' +} + +function _git-bug_bridge_pull { + _arguments \ + '(-n --no-resume)'{-n,--no-resume}'[force importing all bugs]' \ + '(-s --since)'{-s,--since}'[import only bugs updated after the given date (ex: "200h" or "june 2 2019")]:' +} + +function _git-bug_bridge_push { _arguments } -function _git-bug_bridge_token_show { +function _git-bug_bridge_rm { _arguments } -- cgit