mirror of
https://github.com/golang/go.git
synced 2024-09-30 23:07:22 +00:00
go run: correctly handle -n and -x flags
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5557069
This commit is contained in:
parent
46e7cb57c9
commit
c088ebef16
@ -4,7 +4,9 @@
|
||||
|
||||
package main
|
||||
|
||||
import ()
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
var cmdRun = &Command{
|
||||
UsageLine: "run [-a] [-n] [-x] gofiles... [-- arguments...]",
|
||||
@ -42,6 +44,12 @@ func runRun(cmd *Command, args []string) {
|
||||
// runProgram is the action for running a binary that has already
|
||||
// been compiled. We ignore exit status.
|
||||
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)
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user