From 65d7ce7c05a458beb306984c6fd3629839872845 Mon Sep 17 00:00:00 2001 From: Amine Date: Fri, 23 Aug 2019 11:09:03 +0200 Subject: [PATCH] commands: enhance flag description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bridge/github: improve configuration logic Co-Authored-By: Michael Muré --- bridge/github/config.go | 2 +- commands/bridge_configure.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bridge/github/config.go b/bridge/github/config.go index f55ea1b40d2fa4a05e853da5e9d16c886d9d2efb..954bf845ea798bbedd9c48143e701e6dc76e9711 100644 --- a/bridge/github/config.go +++ b/bridge/github/config.go @@ -45,7 +45,7 @@ func (g *Github) Configure(repo repository.RepoCommon, params core.BridgeParams) var project string if params.Token != "" && - !(params.URL != "" || (params.Project != "" && params.Owner != "")) { + (params.URL == "" && (params.Project == "" || params.Owner == "")) { return nil, fmt.Errorf("you must provide a project URL or Owner/Name to configure this bridge with a token") } diff --git a/commands/bridge_configure.go b/commands/bridge_configure.go index 4cfe0ed5dedebeb4e4cce38e2c48f3217152ed67..95cff1a2bccce8f47100c05fe03904b5cbdc0f23 100644 --- a/commands/bridge_configure.go +++ b/commands/bridge_configure.go @@ -191,7 +191,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().BoolVar(&tokenStdin, "token-stdin", false, "Expect to receive token from stdin and ignore token flag.") + bridgeConfigureCmd.Flags().BoolVar(&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 }