builds, trying args

This commit is contained in:
Dan Ballard 2014-12-08 23:54:35 -08:00
parent c3e3805f66
commit a8580683de
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,10 @@
package main package main
import () import (
"fmt"
"log"
"os/exec"
)
var buildCmd = &Command{ var buildCmd = &Command{
Name: "build", Name: "build",
@ -11,5 +15,9 @@ var buildCmd = &Command{
} }
func buildRun(cmd *Command, args ...string) { func buildRun(cmd *Command, args ...string) {
out, err := exec.Command("go", "build", "-ldflags", fmt.Sprintf("\"-X main.Build.Date %s main.Build.GitHash %s main.Build.Num %d\"", "2014-12-08", "a1b2c3d4", 107)).Output()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", out)
} }

View File

@ -18,7 +18,7 @@ Usage:
var usageTmpl = template.Must(template.New("usage").Parse(` var usageTmpl = template.Must(template.New("usage").Parse(`
Commands:{{range .}} Commands:{{range .}}
{{.Name | printf "%-10s"}} {{.Summary}}{{end}} {{.Name | printf "%-10s"}} {{.Summary}}{{end}}
`)) `))
var commands = []*Command{ var commands = []*Command{
buildCmd, buildCmd,