diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/bash_completion/git-bug | 98 | ||||
-rw-r--r-- | misc/powershell_completion/git-bug | 36 | ||||
-rw-r--r-- | misc/zsh_completion/git-bug | 80 |
3 files changed, 107 insertions, 107 deletions
diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug index e8126b8f..9dc3ac87 100644 --- a/misc/bash_completion/git-bug +++ b/misc/bash_completion/git-bug @@ -287,9 +287,9 @@ _git-bug_add() noun_aliases=() } -_git-bug_bridge_configure() +_git-bug_bridge_auth_add-token() { - last_command="git-bug_bridge_configure" + last_command="git-bug_bridge_auth_add-token" command_aliases=() @@ -301,41 +301,19 @@ _git-bug_bridge_configure() flags_with_completion=() flags_completion=() - flags+=("--name=") - two_word_flags+=("--name") - two_word_flags+=("-n") - local_nonpersistent_flags+=("--name=") flags+=("--target=") two_word_flags+=("--target") two_word_flags+=("-t") local_nonpersistent_flags+=("--target=") - flags+=("--url=") - two_word_flags+=("--url") - two_word_flags+=("-u") - local_nonpersistent_flags+=("--url=") - flags+=("--owner=") - two_word_flags+=("--owner") - two_word_flags+=("-o") - local_nonpersistent_flags+=("--owner=") - flags+=("--token=") - two_word_flags+=("--token") - two_word_flags+=("-T") - local_nonpersistent_flags+=("--token=") - flags+=("--token-stdin") - local_nonpersistent_flags+=("--token-stdin") - flags+=("--project=") - two_word_flags+=("--project") - two_word_flags+=("-p") - local_nonpersistent_flags+=("--project=") must_have_one_flag=() must_have_one_noun=() noun_aliases=() } -_git-bug_bridge_pull() +_git-bug_bridge_auth_rm() { - last_command="git-bug_bridge_pull" + last_command="git-bug_bridge_auth_rm" command_aliases=() @@ -347,22 +325,15 @@ _git-bug_bridge_pull() flags_with_completion=() flags_completion=() - flags+=("--no-resume") - flags+=("-n") - local_nonpersistent_flags+=("--no-resume") - flags+=("--since=") - two_word_flags+=("--since") - two_word_flags+=("-s") - local_nonpersistent_flags+=("--since=") must_have_one_flag=() must_have_one_noun=() noun_aliases=() } -_git-bug_bridge_push() +_git-bug_bridge_auth_show() { - last_command="git-bug_bridge_push" + last_command="git-bug_bridge_auth_show" command_aliases=() @@ -380,13 +351,16 @@ _git-bug_bridge_push() noun_aliases=() } -_git-bug_bridge_rm() +_git-bug_bridge_auth() { - last_command="git-bug_bridge_rm" + last_command="git-bug_bridge_auth" command_aliases=() commands=() + commands+=("add-token") + commands+=("rm") + commands+=("show") flags=() two_word_flags=() @@ -400,9 +374,9 @@ _git-bug_bridge_rm() noun_aliases=() } -_git-bug_bridge_token_add() +_git-bug_bridge_configure() { - last_command="git-bug_bridge_token_add" + last_command="git-bug_bridge_configure" command_aliases=() @@ -414,19 +388,41 @@ _git-bug_bridge_token_add() flags_with_completion=() flags_completion=() + flags+=("--name=") + two_word_flags+=("--name") + two_word_flags+=("-n") + local_nonpersistent_flags+=("--name=") flags+=("--target=") two_word_flags+=("--target") two_word_flags+=("-t") local_nonpersistent_flags+=("--target=") + flags+=("--url=") + two_word_flags+=("--url") + two_word_flags+=("-u") + local_nonpersistent_flags+=("--url=") + flags+=("--owner=") + two_word_flags+=("--owner") + two_word_flags+=("-o") + local_nonpersistent_flags+=("--owner=") + flags+=("--token=") + two_word_flags+=("--token") + two_word_flags+=("-T") + local_nonpersistent_flags+=("--token=") + flags+=("--token-stdin") + local_nonpersistent_flags+=("--token-stdin") + flags+=("--project=") + two_word_flags+=("--project") + two_word_flags+=("-p") + local_nonpersistent_flags+=("--project=") must_have_one_flag=() must_have_one_noun=() noun_aliases=() } -_git-bug_bridge_token_rm() +_git-bug_bridge_pull() { - last_command="git-bug_bridge_token_rm" + last_command="git-bug_bridge_pull" command_aliases=() @@ -438,15 +434,22 @@ _git-bug_bridge_token_rm() flags_with_completion=() flags_completion=() + flags+=("--no-resume") + flags+=("-n") + local_nonpersistent_flags+=("--no-resume") + flags+=("--since=") + two_word_flags+=("--since") + two_word_flags+=("-s") + local_nonpersistent_flags+=("--since=") must_have_one_flag=() must_have_one_noun=() noun_aliases=() } -_git-bug_bridge_token_show() +_git-bug_bridge_push() { - last_command="git-bug_bridge_token_show" + last_command="git-bug_bridge_push" command_aliases=() @@ -464,16 +467,13 @@ _git-bug_bridge_token_show() noun_aliases=() } -_git-bug_bridge_token() +_git-bug_bridge_rm() { - last_command="git-bug_bridge_token" + last_command="git-bug_bridge_rm" command_aliases=() commands=() - commands+=("add") - commands+=("rm") - commands+=("show") flags=() two_word_flags=() @@ -494,11 +494,11 @@ _git-bug_bridge() command_aliases=() commands=() + commands+=("auth") commands+=("configure") commands+=("pull") commands+=("push") commands+=("rm") - commands+=("token") flags=() two_word_flags=() diff --git a/misc/powershell_completion/git-bug b/misc/powershell_completion/git-bug index 6a7bf0c3..5f043932 100644 --- a/misc/powershell_completion/git-bug +++ b/misc/powershell_completion/git-bug @@ -48,11 +48,28 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock { break } 'git-bug;bridge' { + [CompletionResult]::new('auth', 'auth', [CompletionResultType]::ParameterValue, 'List all known bridge authentication credentials.') [CompletionResult]::new('configure', 'configure', [CompletionResultType]::ParameterValue, 'Configure a new bridge.') [CompletionResult]::new('pull', 'pull', [CompletionResultType]::ParameterValue, 'Pull updates.') [CompletionResult]::new('push', 'push', [CompletionResultType]::ParameterValue, 'Push updates.') [CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Delete a configured bridge.') - [CompletionResult]::new('token', 'token', [CompletionResultType]::ParameterValue, 'List all known tokens.') + break + } + 'git-bug;bridge;auth' { + [CompletionResult]::new('add-token', 'add-token', [CompletionResultType]::ParameterValue, 'Store a new token') + [CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Remove a credential.') + [CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Display an authentication credential.') + break + } + 'git-bug;bridge;auth;add-token' { + [CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]') + [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]') + break + } + 'git-bug;bridge;auth;rm' { + break + } + 'git-bug;bridge;auth;show' { break } 'git-bug;bridge;configure' { @@ -84,23 +101,6 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock { 'git-bug;bridge;rm' { break } - 'git-bug;bridge;token' { - [CompletionResult]::new('add', 'add', [CompletionResultType]::ParameterValue, 'Store a new token') - [CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Remove a token.') - [CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Display a token.') - break - } - 'git-bug;bridge;token;add' { - [CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]') - [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'The target of the bridge. Valid values are [github,gitlab,launchpad-preview]') - break - } - 'git-bug;bridge;token;rm' { - break - } - 'git-bug;bridge;token;show' { - break - } 'git-bug;commands' { [CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Output the command description as well as Markdown compatible comment') [CompletionResult]::new('--pretty', 'pretty', [CompletionResultType]::ParameterName, 'Output the command description as well as Markdown compatible comment') 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 } |