Skip to content

Commit

Permalink
Add flag to pass config file location
Browse files Browse the repository at this point in the history
  • Loading branch information
mikroskeem committed Jun 17, 2019
1 parent 64b873c commit 039d6ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
func main() {
// CLI options
verbose = *flag.Bool("verbose", false, "Enables verbose logging")
configFile := flag.String("config", "./config.toml", "Configuration file location")
flag.Parse()

// Setup logging
Expand All @@ -32,7 +33,7 @@ func main() {

// Read configuration
var rawConfig []byte
rawConfig, err := ioutil.ReadFile("./config.toml")
rawConfig, err := ioutil.ReadFile(*configFile)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 039d6ad

Please sign in to comment.