Skip to content

Commit

Permalink
cmd/protoc-gen-go-grpc: add --version flag support (#3921)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley authored Oct 2, 2020
1 parent d9063e7 commit 8fbea72
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/protoc-gen-go-grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,24 @@ package main

import (
"flag"
"fmt"

"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/pluginpb"
)

const version = "1.0"

var requireUnimplemented *bool

func main() {
showVersion := flag.Bool("version", false, "print the version and exit")
flag.Parse()
if *showVersion {
fmt.Printf("protoc-gen-go-grpc %v\n", version)
return
}

var flags flag.FlagSet
requireUnimplemented = flags.Bool("require_unimplemented_servers", true, "set to false to match legacy behavior")

Expand Down

0 comments on commit 8fbea72

Please sign in to comment.