From f29d9f7e5e5949cff0b8d875e857b321f33b8bbc Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Fri, 20 Dec 2013 23:35:24 -0800 Subject: [PATCH] Moved verbose to flag. --- config.go | 16 +++++++--------- main.go | 4 ++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config.go b/config.go index d165bd2..198edb7 100644 --- a/config.go +++ b/config.go @@ -5,19 +5,17 @@ import ( ) type Configs struct { - Verbose bool - Dbhost string - Dbname string - Dbport int - Port int + Dbhost string + Dbname string + Dbport int + Port int } func NewConfig() *Configs { return &Configs{ - Verbose: true, - Dbname: "itslog", - Dbport: 5432, - Port: 80, + Dbname: "itslog", + Dbport: 5432, + Port: 80, } } diff --git a/main.go b/main.go index 46c31fd..75a1089 100644 --- a/main.go +++ b/main.go @@ -1,13 +1,17 @@ package main import ( + "flag" "fmt" "github.com/kelseyhightower/envconfig" "log" "net/http" ) +var verbose = flag.Bool("verbose", false, "increase logging verbosity") + func main() { + flag.Parse() log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile) config := NewConfig() err := envconfig.Process("ITSLOG", config)