-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
28 lines (26 loc) · 792 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main
import (
"flag"
"github.com/ngyewch/protoc-gen-twirp-java/generator"
"google.golang.org/protobuf/compiler/protogen"
)
func main() {
var flags flag.FlagSet
genHelidonClient := flags.Bool("gen-helidon-client", false, "Generate Helidon client")
genHelidonServer := flags.Bool("gen-helidon-server", false, "Generate Helidon server")
genApacheClient := flags.Bool("gen-apache-client", false, "Generate Apache client")
opts := &protogen.Options{
ParamFunc: flags.Set,
}
opts.Run(func(plugin *protogen.Plugin) error {
g, err := generator.New(generator.Options{
GenerateHelidonClient: *genHelidonClient,
GenerateHelidonServer: *genHelidonServer,
GenerateApacheClient: *genApacheClient,
})
if err != nil {
return err
}
return g.Generate(plugin)
})
}