From 8b379f895bb0067165d708caafedbdcc400912d4 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Thu, 25 Jun 2020 01:19:08 -0700 Subject: [PATCH] Support config file location as an argument. #20 --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index ac3e7af3a..3b03bef79 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "fmt" log "github.com/sirupsen/logrus" @@ -24,11 +25,10 @@ func main() { // logrus.SetReportCaller(true) 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") - // flag.Parse() + configFile := flag.String("configFile", "config.yaml", "Config File full path. Defaults to current folder") + flag.Parse() - if err := config.Load("config.yaml"); err != nil { + if err := config.Load(*configFile); err != nil { panic(err) }