aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-10 18:30:46 +0100
committerGitHub <noreply@github.com>2019-11-10 18:30:46 +0100
commit802b61e254c40042028d5f08bbed0968e78da265 (patch)
tree1672ea2925533bee62947f6e0a7027b1bff1cb7e /misc
parent350ab761d7b07df9bd49123130fe9807ea9a3d7e (diff)
parente0b15ee7644c20533156850e0be5a07597967450 (diff)
downloadgit-bug-802b61e254c40042028d5f08bbed0968e78da265.tar.gz
Merge pull request #219 from MichaelMure/global-config
Global config, global bridge token
Diffstat (limited to 'misc')
-rw-r--r--misc/bash_completion/git-bug88
-rw-r--r--misc/powershell_completion/git-bug18
-rw-r--r--misc/zsh_completion/git-bug49
3 files changed, 155 insertions, 0 deletions
diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug
index 2088fd4d..9dc3ac87 100644
--- a/misc/bash_completion/git-bug
+++ b/misc/bash_completion/git-bug
@@ -287,6 +287,93 @@ _git-bug_add()
noun_aliases=()
}
+_git-bug_bridge_auth_add-token()
+{
+ last_command="git-bug_bridge_auth_add-token"
+
+ command_aliases=()
+
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--target=")
+ two_word_flags+=("--target")
+ two_word_flags+=("-t")
+ local_nonpersistent_flags+=("--target=")
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
+_git-bug_bridge_auth_rm()
+{
+ last_command="git-bug_bridge_auth_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_auth_show()
+{
+ last_command="git-bug_bridge_auth_show"
+
+ 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_auth()
+{
+ last_command="git-bug_bridge_auth"
+
+ command_aliases=()
+
+ commands=()
+ commands+=("add-token")
+ commands+=("rm")
+ commands+=("show")
+
+ 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_configure()
{
last_command="git-bug_bridge_configure"
@@ -407,6 +494,7 @@ _git-bug_bridge()
command_aliases=()
commands=()
+ commands+=("auth")
commands+=("configure")
commands+=("pull")
commands+=("push")
diff --git a/misc/powershell_completion/git-bug b/misc/powershell_completion/git-bug
index 34037531..5f043932 100644
--- a/misc/powershell_completion/git-bug
+++ b/misc/powershell_completion/git-bug
@@ -48,12 +48,30 @@ 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.')
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' {
[CompletionResult]::new('-n', 'n', [CompletionResultType]::ParameterName, 'A distinctive name to identify the bridge')
[CompletionResult]::new('--name', 'name', [CompletionResultType]::ParameterName, 'A distinctive name to identify the bridge')
diff --git a/misc/zsh_completion/git-bug b/misc/zsh_completion/git-bug
index 9951bab9..230061dd 100644
--- a/misc/zsh_completion/git-bug
+++ b/misc/zsh_completion/git-bug
@@ -114,6 +114,7 @@ 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."
@@ -124,6 +125,9 @@ function _git-bug_bridge {
esac
case "$words[1]" in
+ auth)
+ _git-bug_bridge_auth
+ ;;
configure)
_git-bug_bridge_configure
;;
@@ -139,6 +143,51 @@ function _git-bug_bridge {
esac
}
+
+function _git-bug_bridge_auth {
+ local -a commands
+
+ _arguments -C \
+ "1: :->cmnds" \
+ "*::arg:->args"
+
+ case $state in
+ cmnds)
+ commands=(
+ "add-token:Store a new token"
+ "rm:Remove a credential."
+ "show:Display an authentication credential."
+ )
+ _describe "command" commands
+ ;;
+ esac
+
+ case "$words[1]" in
+ add-token)
+ _git-bug_bridge_auth_add-token
+ ;;
+ rm)
+ _git-bug_bridge_auth_rm
+ ;;
+ show)
+ _git-bug_bridge_auth_show
+ ;;
+ esac
+}
+
+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_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]:' \