aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-08-27 00:32:30 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-08-31 23:02:20 +0200
commitbe94780315b85e51204e28c41fcad34e507d3d3c (patch)
tree39ad8450cbf5fd8c0f4e0c13f4395da67c77ea26 /commands
parent77e60aceeac60e02c253a24faba9603c76228e76 (diff)
downloadgit-bug-be94780315b85e51204e28c41fcad34e507d3d3c.tar.gz
bridge/github: recover terminal state in password prompts
commands: error if a token is provide but not the bridge name and target
Diffstat (limited to 'commands')
-rw-r--r--commands/bridge_configure.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/commands/bridge_configure.go b/commands/bridge_configure.go
index 95cff1a2..bb32c84e 100644
--- a/commands/bridge_configure.go
+++ b/commands/bridge_configure.go
@@ -35,6 +35,10 @@ func runBridgeConfigure(cmd *cobra.Command, args []string) error {
defer backend.Close()
interrupt.RegisterCleaner(backend.Close)
+ if (tokenStdin || bridgeParams.Token != "") && (bridgeConfigureName == "" || bridgeConfigureTarget == "") {
+ return fmt.Errorf("you must bridge name and target to configure a bridge with a token")
+ }
+
if bridgeConfigureTarget == "" {
bridgeConfigureTarget, err = promptTarget()
if err != nil {