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)