summaryrefslogtreecommitdiff
path: root/experiments/windowsconstgen.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-05-25 13:18:45 -0400
committerPietro Gagliardi <[email protected]>2014-05-25 13:18:45 -0400
commita0f10000de25f94a84030e388248a6081faa25c0 (patch)
treeac396f686fd31ad15ac643ef803532bc11e02556 /experiments/windowsconstgen.go
parent98933878482767320d1b9449a84647459f1f749b (diff)
Added the ability to pass arguments to the go tool from the Windows constant generator's command line; this will be for debugging.
Diffstat (limited to 'experiments/windowsconstgen.go')
-rw-r--r--experiments/windowsconstgen.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/experiments/windowsconstgen.go b/experiments/windowsconstgen.go
index 6f76eb7..12f2744 100644
--- a/experiments/windowsconstgen.go
+++ b/experiments/windowsconstgen.go
@@ -78,11 +78,12 @@ func preamble(pkg string) string {
}
func main() {
- if len(os.Args) != 3 {
- panic("usage: " + os.Args[0] + " path goarch")
+ if len(os.Args) < 3 {
+ panic("usage: " + os.Args[0] + " path goarch [go-command-options...]")
}
pkgpath := os.Args[1]
targetarch := os.Args[2]
+ goopts := os.Args[3:] // valid if len(os.Args) == 3; in that case this will just be a slice of length zero
pkg := getPackage(pkgpath)
gatherNames(pkg)
@@ -131,7 +132,9 @@ func main() {
fmt.Fprintf(f, "}\n")
f.Close()
- cmd := exec.Command("go", "run", genoutname)
+ cmd := exec.Command("go", "run")
+ cmd.Args = append(cmd.Args, goopts...)
+ cmd.Args = append(cmd.Args, genoutname)
f, err = os.Create(filepath.Join(pkgpath, "zconstants_windows_" + targetarch + ".go"))
if err != nil {
panic(err)