-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: 'go test -h' prints much more than other -h flags #26999
Comments
I found this while investigating #26998, since both test and vet handle their flags in a special way via the |
Change https://golang.org/cl/129318 mentions this issue: |
/cc @robpike |
For the last two releases, its output has been the same as 'go -h'. The test and vet sub-commands share their flag logic via the cmdflag package, so fixing it there would mean a larger refactor. Moreover, the test subcommand handles its '-h' flag in a special way; that's #26999. For now, use a much less invasive fix, mirroring the special-casing of 'test -h' to simply print vet's short usage text. Also add a regression test via a cmd/go test script. Fixes #26998. Change-Id: Ie6b866d98116a1bc5f84a204e1c9f1c2f6b48bff Reviewed-on: https://go-review.googlesource.com/129318 Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Rob Pike <[email protected]> Reviewed-by: Russ Cox <[email protected]>
Bump @robpike? |
Looks like the same sort of fix as in CL 129318 should work. Not sure why I'm being pinged here. |
Perhaps I should have been clearer - the two issues are unrelated. The problem here is that
It does look like the two texts overlap a bit, but they're definitely not the same. I raised this issue because all other subcommands do have short and long usage texts, but the short one is usually two lines. In this case, the short one is actually the longest, and spans hundreds of lines. |
To further clarify - I simply need help deciding what to do here. To me, |
It seems clear that |
go test -h should be fixed to output 2 lines. |
Change https://golang.org/cl/144558 mentions this issue: |
I know that this issue body is massive - it helps me prove my point. All
go <cmd> -h
outputs are tiny and quick, yet test's is the exact opposite for no apparent reason.If this much information is needed, I suggest putting it in
go help test
, or if it doesn't fit there, perhaps another help document likego help testing
.The text was updated successfully, but these errors were encountered: