diff --git a/main.go b/main.go index 6bf9d7d..fae3df0 100644 --- a/main.go +++ b/main.go @@ -52,6 +52,10 @@ func main() { config := proxy.NewConfig() command := flag.NewFlagSet(os.Args[1], flag.ExitOnError) + configFile := command.String("config", "./.ergo", "Set the services file") + command.Parse(os.Args[2:]) + + config.Services = proxy.LoadConfig(*configFile) switch os.Args[1] { case "list": @@ -84,8 +88,6 @@ func main() { case "run": command.StringVar(&config.Port, "p", "2000", "Set port to the proxy") command.BoolVar(&config.Verbose, "V", false, "Set verbosity on proxy output") - configFile := command.String("config", "./.ergo", "Set the services file") - config.Services = proxy.LoadConfig(*configFile) command.Parse(os.Args[2:]) commands.Run(config)