diff options
author | amine <hilalyamine@gmail.com> | 2019-11-23 19:21:14 +0100 |
---|---|---|
committer | amine <hilalyamine@gmail.com> | 2019-11-23 19:26:27 +0100 |
commit | 09db1cda71c87d87e700eabbecf89e10a0923d43 (patch) | |
tree | 7212ba27f0bfb00d5218f3e6cf645ba4d24a6596 /commands | |
parent | 014e754fcdcd59c633e2bfc490fe34b0dcd0d89a (diff) | |
download | git-bug-09db1cda71c87d87e700eabbecf89e10a0923d43.tar.gz |
commands: add bridge configure --token-id flag
Diffstat (limited to 'commands')
-rw-r--r-- | commands/bridge_configure.go | 4 |
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 |