aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-10-12 18:10:44 +0900
committeramine <hilalyamine@gmail.com>2019-11-09 13:26:48 +0100
commit3984919a3df95b8ec203bcb82b66c9c2270579c7 (patch)
tree1a32f0978e76f097edf2635191e6940b990efe05 /misc
parent3433fa5def3fb3c2707bae1aeb4ae1bd62c930de (diff)
downloadgit-bug-3984919a3df95b8ec203bcb82b66c9c2270579c7.tar.gz
bridge: various cleanups
Diffstat (limited to 'misc')
-rw-r--r--misc/bash_completion/git-bug84
-rw-r--r--misc/powershell_completion/git-bug28
-rw-r--r--misc/zsh_completion/git-bug46
3 files changed, 158 insertions, 0 deletions
diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug
index 2088fd4d..9c719949 100644
--- a/misc/bash_completion/git-bug
+++ b/misc/bash_completion/git-bug
@@ -400,6 +400,89 @@ _git-bug_bridge_rm()
noun_aliases=()
}
+_git-bug_bridge_token_add()
+{
+ last_command="git-bug_bridge_token_add"
+
+ command_aliases=()
+
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--global")
+ flags+=("-g")
+ local_nonpersistent_flags+=("--global")
+ flags+=("--value=")
+ two_word_flags+=("--value")
+ two_word_flags+=("-v")
+ local_nonpersistent_flags+=("--value=")
+ flags+=("--target=")
+ two_word_flags+=("--target")
+ two_word_flags+=("-t")
+ local_nonpersistent_flags+=("--target=")
+ flags+=("--scopes=")
+ two_word_flags+=("--scopes")
+ two_word_flags+=("-s")
+ local_nonpersistent_flags+=("--scopes=")
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
+_git-bug_bridge_token_rm()
+{
+ last_command="git-bug_bridge_token_rm"
+
+ command_aliases=()
+
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
+_git-bug_bridge_token()
+{
+ last_command="git-bug_bridge_token"
+
+ command_aliases=()
+
+ commands=()
+ commands+=("add")
+ commands+=("rm")
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--local")
+ flags+=("-l")
+ local_nonpersistent_flags+=("--local")
+ flags+=("--global")
+ flags+=("-g")
+ local_nonpersistent_flags+=("--global")
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
_git-bug_bridge()
{
last_command="git-bug_bridge"
@@ -411,6 +494,7 @@ _git-bug_bridge()
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 34037531..e875b8a2 100644
--- a/misc/powershell_completion/git-bug
+++ b/misc/powershell_completion/git-bug
@@ -22,6 +22,7 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
[CompletionResult]::new('commands', 'commands', [CompletionResultType]::ParameterValue, 'Display available commands.')
[CompletionResult]::new('comment', 'comment', [CompletionResultType]::ParameterValue, 'Display or add comments to a bug.')
[CompletionResult]::new('deselect', 'deselect', [CompletionResultType]::ParameterValue, 'Clear the implicitly selected bug.')
+ [CompletionResult]::new('export', 'export', [CompletionResultType]::ParameterValue, '')
[CompletionResult]::new('label', 'label', [CompletionResultType]::ParameterValue, 'Display, add or remove labels to/from a bug.')
[CompletionResult]::new('ls', 'ls', [CompletionResultType]::ParameterValue, 'List bugs.')
[CompletionResult]::new('ls-id', 'ls-id', [CompletionResultType]::ParameterValue, 'List bug identifiers.')
@@ -52,6 +53,7 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
[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, 'Configure and use bridge tokens.')
break
}
'git-bug;bridge;configure' {
@@ -83,6 +85,29 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
'git-bug;bridge;rm' {
break
}
+ 'git-bug;bridge;token' {
+ [CompletionResult]::new('-l', 'l', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('--local', 'local', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('-g', 'g', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('--global', 'global', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('add', 'add', [CompletionResultType]::ParameterValue, 'Configure and use bridge tokens.')
+ [CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Configure and use bridge tokens.')
+ break
+ }
+ 'git-bug;bridge;token;add' {
+ [CompletionResult]::new('-g', 'g', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('--global', 'global', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('--value', 'value', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('-t', 't', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('-s', 's', [CompletionResultType]::ParameterName, '')
+ [CompletionResult]::new('--scopes', 'scopes', [CompletionResultType]::ParameterName, '')
+ break
+ }
+ 'git-bug;bridge;token;rm' {
+ 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')
@@ -102,6 +127,9 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
'git-bug;deselect' {
break
}
+ 'git-bug;export' {
+ break
+ }
'git-bug;label' {
[CompletionResult]::new('add', 'add', [CompletionResultType]::ParameterValue, 'Add a label to a bug.')
[CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Remove a label from a bug.')
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]'