g2i/cmd/args.go

24 lines
373 B
Go
Raw Permalink Normal View History

2019-03-14 18:42:15 +03:00
package main
import (
"flag"
2019-03-16 16:24:35 +03:00
log "github.com/sirupsen/logrus"
2019-03-14 18:42:15 +03:00
)
var (
filePath string
2019-03-16 16:24:35 +03:00
debug bool
2019-03-14 18:42:15 +03:00
)
func init() {
flag.StringVar(&filePath, "config", "config.json", "Path to the configuration file")
2019-03-16 16:24:35 +03:00
flag.BoolVar(&debug, "debug", false, "Enable debug output")
2019-03-14 18:42:15 +03:00
flag.Parse()
2019-03-16 16:24:35 +03:00
if debug {
log.SetLevel(log.DebugLevel)
log.Debug("Debug output is enabled")
}
2019-03-14 18:42:15 +03:00
}