From 92cdcd90bf52150d9c63b7a8432ab7b10fc92385 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 20 Dec 2018 12:12:42 +1100 Subject: [PATCH] godoc: choose a smaller-output example as help when there are unexpected arguments Change CL 153869 added a help message when there are leftover arguments, as that used to invoke the command-line interface that is now gone. But the example in the help text (go doc -all net/http) generates a huge amount of output. Use a very simple, small-output example instead, to illustrate how to solve the problem without scrolling the program description hundreds of screenfuls away. Change-Id: I1887af1f3e853bf3a852dc374746074f1cd39441 Reviewed-on: https://go-review.googlesource.com/c/155157 Reviewed-by: Ian Lance Taylor --- cmd/godoc/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/godoc/main.go b/cmd/godoc/main.go index 849bd5db..c27ede76 100644 --- a/cmd/godoc/main.go +++ b/cmd/godoc/main.go @@ -165,7 +165,7 @@ func main() { // Check usage. if flag.NArg() > 0 { - fmt.Fprintln(os.Stderr, `Unexpected arguments. Use "go doc" for command-line help output instead. For example, "go doc -all net/http".`) + fmt.Fprintln(os.Stderr, `Unexpected arguments. Use "go doc" for command-line help output instead. For example, "go doc fmt.Printf".`) usage() } if *httpAddr != "" && *urlFlag != "" && !*writeIndex {