Explorar o código

show help when running goctl rpc protoc without any flags (#1683)

fang duan %!s(int64=3) %!d(string=hai) anos
pai
achega
97bf3856c1
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      tools/goctl/rpc/cli/zrpc.go

+ 4 - 0
tools/goctl/rpc/cli/zrpc.go

@@ -23,6 +23,10 @@ var (
 // ZRPC generates grpc code directly by protoc and generates
 // zrpc code by goctl.
 func ZRPC(c *cli.Context) error {
+	if c.NumFlags() == 0 {
+		cli.ShowCommandHelpAndExit(c, "protoc", 1)
+	}
+
 	args := c.Parent().Args()
 	protocArgs := removeGoctlFlag(args)
 	pwd, err := os.Getwd()