From 26b1b4ece3ff822eec7a7c4ec3968f09d10af7b7 Mon Sep 17 00:00:00 2001 From: Matt DeBoer Date: Fri, 16 Jun 2017 14:59:23 -0700 Subject: [PATCH] missed parsing of target url --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index c4ba2d2..788d5c1 100644 --- a/main.go +++ b/main.go @@ -183,6 +183,16 @@ func parseFlags(c *cli.Context) (creds *authContext, targetURL *url.URL) { creds.AuthEndpoint = authEndpoint } + if len(target) > 0 { + t, err := url.Parse(target) + if err != nil { + println(fmt.Sprintf("ERROR: 'target' %s is invalid: %v\n", target, err)) + cli.ShowAppHelp(c) + os.Exit(1) + } + targetURL = t + } + } else { if len(secret) == 0 && len(secretFile) == 0 {