/
protoc_cmd.go
42 lines (40 loc) · 1012 Bytes
/
protoc_cmd.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package protoc
import "github.com/urfave/cli"
var Cmd = cli.Command{
Name: "protoc",
Aliases: []string{"p"},
Usage: "jupiter protoc tools",
Action: Run,
SkipFlagParsing: false,
UsageText: ProtocHelpTemplate,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "grpc,g",
Usage: "whether to generate GRPC code",
Destination: &option.withGRPC,
},
&cli.BoolFlag{
Name: "server,s",
Usage: "whether to generate grpc server code",
Destination: &option.withServer,
},
&cli.StringFlag{
Name: "file,f",
Usage: "Path of proto file",
Required: true,
Destination: &option.protoFilePath,
},
&cli.StringFlag{
Name: "out,o",
Usage: "Path of code generation",
Required: true,
Destination: &option.outputDir,
},
&cli.StringFlag{
Name: "prefix,p",
Usage: "prefix(current project name)",
Required: false,
Destination: &option.prefix,
},
},
}