diff --git a/main.go b/main.go index 9614a10..e37bade 100644 --- a/main.go +++ b/main.go @@ -62,15 +62,20 @@ func run(args []string) int { fmt.Fprintf(os.Stderr, "Error: %s\n", err.Error()) return 1 default: - url = args[0] + // url = args[0] } + url = args[len(args)-1] + env, err := cfg.GetEnv(url) if err != nil { fmt.Fprintf(os.Stderr, "Error: %s\n", err.Error()) fmt.Fprintf(os.Stderr, " similar urls found %q\n", cfg.SimilarURLs(url)) return 1 } + credentials = os.Getenv(GoogleApplicationCredentials) + clientID = os.Getenv(IAPClientID) + binary = os.Getenv(IAPCurlBinary) if credentials == "" { credentials, _ = homedir.Expand(env.Credentials) }