diff --git a/cmd/protoc-gen-go/main.go b/cmd/protoc-gen-go/main.go index b5150602..0559ee33 100644 --- a/cmd/protoc-gen-go/main.go +++ b/cmd/protoc-gen-go/main.go @@ -21,6 +21,7 @@ import ( "google.golang.org/protobuf/internal/version" ) +const genGoDocURL = "https://developers.google.com/protocol-buffers/docs/reference/go-generated" const grpcDocURL = "https://grpc.io/docs/languages/go/quickstart/#regenerate-grpc-code" func main() { @@ -28,6 +29,10 @@ func main() { fmt.Fprintf(os.Stdout, "%v %v\n", filepath.Base(os.Args[0]), version.String()) os.Exit(0) } + if len(os.Args) == 2 && os.Args[1] == "--help" { + fmt.Fprintf(os.Stdout, "See "+genGoDocURL+" for usage information.\n") + os.Exit(0) + } var ( flags flag.FlagSet