cmd/protoc-gen-go: support --help flag

When someone has no idea what a binary does, it is convention to
pass the "--help" flag. When done, we should point the user
to the devsite documentation on protoc with protoc-gen-go.

Change-Id: I36289a1ae025b9e12521b34362370aba5235a44b
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/302330
Trust: Joe Tsai <joetsai@digital-static.net>
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/cmd/protoc-gen-go/main.go b/cmd/protoc-gen-go/main.go
index b515060..0559ee3 100644
--- a/cmd/protoc-gen-go/main.go
+++ b/cmd/protoc-gen-go/main.go
@@ -21,6 +21,7 @@
 	"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 @@
 		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