From 9f8f0194a3c21e640a5b917f86bf204c014d730d Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Wed, 8 Aug 2018 21:52:34 +0100 Subject: Correct client behaviours for option handling A config file is not required - don't error if one doesn't exist. Don't overwrite default options with an empty string. --- cmd/cashier/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/cashier/main.go b/cmd/cashier/main.go index 2b24364..f0ba2f1 100644 --- a/cmd/cashier/main.go +++ b/cmd/cashier/main.go @@ -36,17 +36,17 @@ func main() { c, err := client.ReadConfig(*cfg) if err != nil { - log.Printf("Error parsing config file: %v\n", err) - } - fmt.Printf("Your browser has been opened to visit %s\n", c.CA) - if err := browser.OpenURL(c.CA); err != nil { - fmt.Println("Error launching web browser. Go to the link in your web browser") + log.Printf("Configuration error: %v\n", err) } fmt.Println("Generating new key pair") priv, pub, err := client.GenerateKey(client.KeyType(c.Keytype), client.KeySize(c.Keysize)) if err != nil { log.Fatalln("Error generating key pair: ", err) } + fmt.Printf("Your browser has been opened to visit %s\n", c.CA) + if err := browser.OpenURL(c.CA); err != nil { + fmt.Println("Error launching web browser. Go to the link in your web browser") + } fmt.Print("Enter token: ") var token string -- cgit v1.2.3