Support config file location as an argument. #20
This commit is contained in:
parent
4132cf6d09
commit
8b379f895b
8
main.go
8
main.go
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -24,11 +25,10 @@ func main() {
|
|||||||
// logrus.SetReportCaller(true)
|
// logrus.SetReportCaller(true)
|
||||||
log.Println(getVersion())
|
log.Println(getVersion())
|
||||||
|
|
||||||
//TODO: potentially load the config from a flag like:
|
configFile := flag.String("configFile", "config.yaml", "Config File full path. Defaults to current folder")
|
||||||
//configFile := flag.String("configFile", "config.yaml", "Config File full path. Defaults to current folder")
|
flag.Parse()
|
||||||
// flag.Parse()
|
|
||||||
|
|
||||||
if err := config.Load("config.yaml"); err != nil {
|
if err := config.Load(*configFile); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user