From b625810d28adde8c24da4838525694e74e131520 Mon Sep 17 00:00:00 2001 From: Tormod Erevik Lea Date: Sat, 17 Sep 2016 19:04:46 +0200 Subject: [PATCH] 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 --- src/cmd/vet/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go index 81063856dd..b317c88738 100644 --- a/src/cmd/vet/main.go +++ b/src/cmd/vet/main.go @@ -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")