mirror of https://github.com/grpc/grpc-go.git
cmd/protoc-gen-go-grpc: add --version flag support (#3921)
This commit is contained in:
parent
d9063e7af3
commit
8fbea72764
|
|
@ -32,14 +32,24 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"google.golang.org/protobuf/compiler/protogen"
|
"google.golang.org/protobuf/compiler/protogen"
|
||||||
"google.golang.org/protobuf/types/pluginpb"
|
"google.golang.org/protobuf/types/pluginpb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const version = "1.0"
|
||||||
|
|
||||||
var requireUnimplemented *bool
|
var requireUnimplemented *bool
|
||||||
|
|
||||||
func main() {
|
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
|
var flags flag.FlagSet
|
||||||
requireUnimplemented = flags.Bool("require_unimplemented_servers", true, "set to false to match legacy behavior")
|
requireUnimplemented = flags.Bool("require_unimplemented_servers", true, "set to false to match legacy behavior")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue