diff --git a/config.json b/beretta.json similarity index 100% rename from config.json rename to beretta.json diff --git a/src/main.go b/src/main.go index e34c630..995bcb6 100644 --- a/src/main.go +++ b/src/main.go @@ -1,6 +1,7 @@ package main import ( + "flag" "log" "math/rand" "time" @@ -40,8 +41,14 @@ func repoThread(c chan RepoUpdate, repo Repo, avgInterval int, db Db) { } func main() { + + conf := flag.String("config", "./beretta.json", "The path to the config file") + flag.Parse() + + log.Printf("Using config path: %s", *conf) + // Load configuration - config, err := loadConfig("config.json") + config, err := loadConfig(*conf) if err != nil { log.Fatalf("Failed to load configuration: %v", err) }