mirror of
https://github.com/golang/go
synced 2024-11-18 10:54:40 -07:00
cmd/godoc: print a helpful error if used for command-line docs
The command-line interface was recently removed in favor of "go doc". Change-Id: Idfcfca3b2eafaf63148a2ed88d4d25c61d9e3c69 Reviewed-on: https://go-review.googlesource.com/c/153869 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
d4971274fe
commit
88e3b261f2
@ -163,15 +163,13 @@ func main() {
|
||||
|
||||
playEnabled = *showPlayground
|
||||
|
||||
// Check usage: server and no args.
|
||||
if (*httpAddr != "" || *urlFlag != "") && (flag.NArg() > 0) {
|
||||
fmt.Fprintln(os.Stderr, "Unexpected arguments.")
|
||||
// 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".`)
|
||||
usage()
|
||||
}
|
||||
|
||||
// Check usage: command line args or index creation mode.
|
||||
if (*httpAddr != "" || *urlFlag != "") != (flag.NArg() == 0) && !*writeIndex {
|
||||
fmt.Fprintln(os.Stderr, "missing args.")
|
||||
if *httpAddr != "" && *urlFlag != "" && !*writeIndex {
|
||||
fmt.Fprintln(os.Stderr, "Missing args.")
|
||||
usage()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user