From 9663e486dcca0b337e168312d8dc68f0670d623e Mon Sep 17 00:00:00 2001 From: Agis Anastasopoulos Date: Tue, 10 Apr 2018 17:24:58 +0300 Subject: [PATCH] Add a default value to `--config` option Fixes #22 --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index d51d47e..08a4178 100644 --- a/main.go +++ b/main.go @@ -71,6 +71,7 @@ func main() { }, cli.StringFlag{ Name: "config, c", + Value: "config.json", Usage: "Load configuration from `FILE`", }, cli.StringFlag{ @@ -87,7 +88,7 @@ func main() { f, err := os.Open(c.String("config")) if err != nil { - return err + return fmt.Errorf("cannot parse configuration; %s", err) } cfg, err := ParseConfig(c.String("addr"), fs, f) if err != nil {