Commit c088ebef authored by Shenghou Ma's avatar Shenghou Ma Committed by Russ Cox

go run: correctly handle -n and -x flags

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5557069
parent 46e7cb57
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
package main package main
import () import (
"strings"
)
var cmdRun = &Command{ var cmdRun = &Command{
UsageLine: "run [-a] [-n] [-x] gofiles... [-- arguments...]", UsageLine: "run [-a] [-n] [-x] gofiles... [-- arguments...]",
...@@ -42,6 +44,12 @@ func runRun(cmd *Command, args []string) { ...@@ -42,6 +44,12 @@ func runRun(cmd *Command, args []string) {
// runProgram is the action for running a binary that has already // runProgram is the action for running a binary that has already
// been compiled. We ignore exit status. // been compiled. We ignore exit status.
func (b *builder) runProgram(a *action) error { func (b *builder) runProgram(a *action) error {
if buildN || buildX {
b.showcmd("", "%s %s", a.deps[0].target, strings.Join(a.args, " "))
if buildN {
return nil
}
}
run(a.deps[0].target, a.args) run(a.deps[0].target, a.args)
return nil return nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment