From 97bf3856c1bcea5380e00f01d6659130ada0d905 Mon Sep 17 00:00:00 2001 From: fang duan Date: Sun, 17 Apr 2022 20:57:26 +0800 Subject: [PATCH] show help when running goctl rpc protoc without any flags (#1683) --- tools/goctl/rpc/cli/zrpc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/goctl/rpc/cli/zrpc.go b/tools/goctl/rpc/cli/zrpc.go index 2550f66c..c99c454b 100644 --- a/tools/goctl/rpc/cli/zrpc.go +++ b/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()