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 <iant@golang.org>
This commit is contained in:
parent
6e267b5cc7
commit
92cdcd90bf
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue