瀏覽代碼

show help when running goctl rpc template without any flags (#1685)

close #1684
fang duan 3 年之前
父節點
當前提交
0cc9d4ff8d
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      tools/goctl/rpc/cli/cli.go

+ 4 - 0
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")