Make confg path an arg
This commit is contained in:
parent
43ba2914de
commit
a7d1b8ab74
3
main.go
3
main.go
@ -84,6 +84,7 @@ func main() {
|
||||
flag.BoolVar(&LogDebug, "debug", false, "Enables debug logs (default: false)")
|
||||
flag.BoolVar(&ExportMetrics, "metrics", false, "Enables prometheus metrics exporting (default: false)")
|
||||
var showVersion = flag.Bool("version", false, "Display the version of minitor and exit")
|
||||
var configPath = flag.String("config", "config.yml", "Alternate configuration path (default: config.yml)")
|
||||
flag.Parse()
|
||||
|
||||
// Print version if flag is provided
|
||||
@ -93,7 +94,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Load configuration
|
||||
config, err := LoadConfig("config.yml")
|
||||
config, err := LoadConfig(*configPath)
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user