aboutsummaryrefslogtreecommitdiffstats
path: root/commands/bridge_configure.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-24 23:54:23 +0100
committerGitHub <noreply@github.com>2019-11-24 23:54:23 +0100
commit44f648a931b43d707d37cb469fead5e21a615e04 (patch)
tree356bbe10b81a1ed06ded54a5570027fda51fead6 /commands/bridge_configure.go
parent6345895a3d9a055927f1d4b78f254a55c1d271b6 (diff)
parent06abb5a5312dfaa1edac58cced94691e477c2ed7 (diff)
downloadgit-bug-44f648a931b43d707d37cb469fead5e21a615e04.tar.gz
Merge pull request #260 from MichaelMure/bridge
Support bridge configuration with global tokens
Diffstat (limited to 'commands/bridge_configure.go')
-rw-r--r--commands/bridge_configure.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/commands/bridge_configure.go b/commands/bridge_configure.go
index 3562af17..6f314135 100644
--- a/commands/bridge_configure.go
+++ b/commands/bridge_configure.go
@@ -34,7 +34,8 @@ func runBridgeConfigure(cmd *cobra.Command, args []string) error {
defer backend.Close()
interrupt.RegisterCleaner(backend.Close)
- if (bridgeParams.TokenStdin || bridgeParams.Token != "") && (bridgeConfigureName == "" || bridgeConfigureTarget == "") {
+ if (bridgeParams.TokenStdin || bridgeParams.Token != "" || bridgeParams.TokenId != "") &&
+ (bridgeConfigureName == "" || bridgeConfigureTarget == "") {
return fmt.Errorf("you must provide a bridge name and target to configure a bridge with a token")
}
@@ -195,6 +196,7 @@ func init() {
bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.URL, "url", "u", "", "The URL of the target repository")
bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.Owner, "owner", "o", "", "The owner of the target repository")
bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.Token, "token", "T", "", "The authentication token for the API")
+ bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.TokenId, "token-id", "i", "", "The authentication token identifier for the API")
bridgeConfigureCmd.Flags().BoolVar(&bridgeParams.TokenStdin, "token-stdin", false, "Will read the token from stdin and ignore --token")
bridgeConfigureCmd.Flags().StringVarP(&bridgeParams.Project, "project", "p", "", "The name of the target repository")
bridgeConfigureCmd.Flags().SortFlags = false