Skip to content

Commit

Permalink
print help message if config was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Griesbacher committed Jun 7, 2017
1 parent 8165744 commit f633e1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ For further informations / bugs reportes: https://github.com/Griesbacher/nagflux
}

//Load config
if _, err := os.Stat(configPath); os.IsNotExist(err) {
fmt.Printf("Can not find config file: '%s'.\n\nHelp:\n", configPath)
flag.Usage()
os.Exit(1)
}
config.InitConfig(configPath)
cfg := config.GetConfig()

Expand Down Expand Up @@ -178,7 +183,7 @@ For further informations / bugs reportes: https://github.com/Griesbacher/nagflux
cleanUp(stoppables, resultQueues)
quit <- true
}()
loop:
loop:
//Main loop
for {
select {
Expand Down

0 comments on commit f633e1c

Please sign in to comment.