Skip to content

Commit

Permalink
fix: Config flag missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Oliveira committed Sep 11, 2017
1 parent 0bcde22 commit 19b8cfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 19b8cfa

Please sign in to comment.