Skip to content

Commit

Permalink
add command line parameter for overriding the http.port
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesward committed Sep 26, 2012
1 parent 48c46d2 commit da0a740
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/run.go
@@ -1,6 +1,7 @@
package main

import (
"github.com/robfig/goconfig/config"
"github.com/robfig/revel"
"github.com/robfig/revel/harness"
"log"
Expand Down Expand Up @@ -32,12 +33,18 @@ func runApp(args []string) {
}

mode := "dev"
if len(args) == 2 {
if len(args) >= 2 {
mode = args[1]
}

// Find and parse app.conf
rev.Init(mode, args[0], "")

if len(args) == 3 {
// change http.port config
rev.Config.AddOption(config.DEFAULT_SECTION, "http.port", args[2])

This comment has been minimized.

Copy link
@robfig

robfig Sep 28, 2012

You should use AddOption(mode, ... ), in case they have mode-specific ports in there. (It may not fall back to DEFAULT_SECTION)

}

log.Printf("Running %s (%s) in %s mode\n", rev.AppName, rev.ImportPath, mode)
rev.TRACE.Println("Base path:", rev.BasePath)

Expand Down

1 comment on commit da0a740

@robfig
Copy link

@robfig robfig commented on da0a740 Sep 28, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the tool's help as well.

Please sign in to comment.