Permalink
Browse files

use the specified mode and add help info for new port parameter

  • Loading branch information...
1 parent 10af918 commit 84793217dc35a0a821ff4be3ea26377da39545fa @jamesward committed Oct 9, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 cmd/run.go
View
@@ -1,14 +1,13 @@
package main
import (
- "github.com/robfig/goconfig/config"
"github.com/robfig/revel"
"github.com/robfig/revel/harness"
"log"
)
var cmdRun = &Command{
- UsageLine: "run [import path] [run mode]",
+ UsageLine: "run [import path] [run mode] [port]",
Short: "run a Revel application",
Long: `
Run the Revel web application named by the given import path.
@@ -20,7 +19,12 @@ For example, to run the chat room sample application:
The run mode is used to select which set of app.conf configuration should
apply and may be used to determine logic in the application itself.
-Run mode defaults to "dev".`,
+Run mode defaults to "dev".
+
+You can set a port as an optional third parameter. For example:
+
+ revel run github.com/robfig/revel/samples/chat prod 8080`,
+
}
func init() {
@@ -42,7 +46,7 @@ func runApp(args []string) {
if len(args) == 3 {
// change http.port config
- rev.Config.AddOption(config.DEFAULT_SECTION, "http.port", args[2])
+ rev.Config.AddOption(mode, "http.port", args[2])
}
log.Printf("Running %s (%s) in %s mode\n", rev.AppName, rev.ImportPath, mode)

0 comments on commit 8479321

Please sign in to comment.