aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2018-08-08 21:52:34 +0100
committerNiall Sheridan <nsheridan@gmail.com>2018-08-08 22:54:43 +0100
commit9f8f0194a3c21e640a5b917f86bf204c014d730d (patch)
tree6921f64032a8eea7adeedfba156b62e2e6925969 /cmd
parent12417f0dddf4be86aa5b9a4cb25bf48a4e301086 (diff)
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.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cashier/main.go10
1 files changed, 5 insertions, 5 deletions
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