瀏覽代碼

allow choosing which "phase" to run.

Lucas Stadler 11 年之前
父節點
當前提交
2922be5f82
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      go/qst.go

+ 3 - 2
go/qst.go

@ -33,6 +33,7 @@ var delay = flag.Duration("delay", 1*time.Second, "time to wait until restart")
33 33
var autoRestart = flag.Bool("autorestart", true, "automatically restart after command exists")
34 34
var command = flag.String("command", "", "command to run ({file} will be substituted)")
35 35
var projectType = flag.String("type", "", "project type to use (autodetected if not present)")
36
var phase = flag.String("phase", "run", "which phase to run (build, run or test)")
36 37
37 38
func main() {
38 39
	log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
@ -73,9 +74,9 @@ func main() {
73 74
			log.Fatal("error: ", err)
74 75
		}
75 76
		log.Printf("detected a %s project", project.Id)
76
		projectCmd, found := project.Commands["run"]
77
		projectCmd, found := project.Commands[*phase]
77 78
		if !found {
78
			log.Fatalf("%s doesn't support `run'", project.Id)
79
			log.Fatalf("%s doesn't support `%s'", project.Id, *phase)
79 80
		}
80 81
		cmd = projectCmd
81 82
	}