Allow specifying config path as an argument
This commit is contained in:
parent
3b963f420f
commit
eb7ad0b25e
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