From 0cc9d4ff8d1131d5bee80498c142a419f3ee005f Mon Sep 17 00:00:00 2001 From: fang duan Date: Fri, 8 Apr 2022 22:28:45 +0800 Subject: [PATCH] show help when running goctl rpc template without any flags (#1685) close #1684 --- tools/goctl/rpc/cli/cli.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/goctl/rpc/cli/cli.go b/tools/goctl/rpc/cli/cli.go index be98b315a..b45f202a6 100644 --- a/tools/goctl/rpc/cli/cli.go +++ b/tools/goctl/rpc/cli/cli.go @@ -59,6 +59,10 @@ func RPCNew(c *cli.Context) error { // RPCTemplate is the entry for generate rpc template func RPCTemplate(c *cli.Context) error { + if c.NumFlags() == 0 { + cli.ShowCommandHelpAndExit(c, "template", 1) + } + protoFile := c.String("o") home := c.String("home") remote := c.String("remote")