cmd/go: show testflag help for "go test -h"

Fixes #6576.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14502065
This commit is contained in:
Shenghou Ma 2013-12-18 17:40:31 -05:00
parent 2b3ad827a6
commit 8606b97690
1 changed files with 5 additions and 0 deletions

View File

@ -238,6 +238,11 @@ func printUsage(w io.Writer) {
}
func usage() {
// special case "go test -h"
if len(os.Args) > 1 && os.Args[1] == "test" {
help([]string{"testflag"})
os.Exit(2)
}
printUsage(os.Stderr)
os.Exit(2)
}