cmd/protoc-gen-go-grpc: add --version flag support (#3921)
This commit is contained in:
Родитель
d9063e7af3
Коммит
8fbea72764
|
@ -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")
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче