cmd/release: add --watch flag to stream output

Change-Id: I97ab70f3d05ca17b9ab752bf0a6a7c46c2693167
Reviewed-on: https://go-review.googlesource.com/18016
Reviewed-by: Chris Broadfoot <cbro@golang.org>
diff --git a/cmd/release/release.go b/cmd/release/release.go
index c38284d..9274c23 100644
--- a/cmd/release/release.go
+++ b/cmd/release/release.go
@@ -32,6 +32,7 @@
 
 var (
 	target = flag.String("target", "", "If specified, build specific target platform ('linux-amd64')")
+	watch  = flag.Bool("watch", false, "Watch the build. Only compatible with -target")
 
 	rev       = flag.String("rev", "", "Go revision to build")
 	toolsRev  = flag.String("tools", "", "Tools revision to build")
@@ -323,8 +324,12 @@
 		scriptArgs = bc.MakeScriptArgs()
 	}
 	all := filepath.Join(goDir, script)
+	var execOut io.Writer = out
+	if *watch && *target != "" {
+		execOut = io.MultiWriter(out, os.Stdout)
+	}
 	remoteErr, err := client.Exec(all, buildlet.ExecOpts{
-		Output:   out,
+		Output:   execOut,
 		ExtraEnv: env,
 		Args:     scriptArgs,
 	})