]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: show testflag help for "go test -h"
authorShenghou Ma <minux.ma@gmail.com>
Wed, 18 Dec 2013 22:40:31 +0000 (17:40 -0500)
committerShenghou Ma <minux.ma@gmail.com>
Wed, 18 Dec 2013 22:40:31 +0000 (17:40 -0500)
Fixes #6576.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14502065

src/cmd/go/main.go

index df0cf1b3fde0e2f930b47c6a22a63bb73b8a8996..7f4c75866c12144ae556820d54a7167331380107 100644 (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)
 }