1
0
mirror of https://github.com/golang/go synced 2024-09-30 19:38:33 -06:00

cmd/vet: hard-code program name in usage message

Example on linux_amd64 for 'go tool vet -h':

Before:
	Usage of /usr/local/go/pkg/tool/linux_amd64/vet:
After:
	Usage of vet:

Change-Id: I11cb16b656bd097062d57a8c7441fbe66caaef78
Reviewed-on: https://go-review.googlesource.com/29294
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Tormod Erevik Lea 2016-09-17 19:04:46 +02:00 committed by Rob Pike
parent 3cca069220
commit b625810d28

View File

@ -161,7 +161,7 @@ func register(name, usage string, fn func(*File, ast.Node), types ...ast.Node) {
// Usage is a replacement usage function for the flags package.
func Usage() {
fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
fmt.Fprintf(os.Stderr, "Usage of vet:\n")
fmt.Fprintf(os.Stderr, "\tvet [flags] directory...\n")
fmt.Fprintf(os.Stderr, "\tvet [flags] files... # Must be a single package\n")
fmt.Fprintf(os.Stderr, "By default, -all is set and all non-experimental checks are run.\n")