mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-03 00:38:40 +08:00
add goctl rpc template home flag (#871)
Co-authored-by: suzhenpeng <suzhenpeng@ecoplants.tech>
This commit is contained in:
parent
6793f7a1de
commit
00061c2e5b
@ -367,6 +367,10 @@ var (
|
|||||||
Name: "out, o",
|
Name: "out, o",
|
||||||
Usage: "the target path of proto",
|
Usage: "the target path of proto",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "home",
|
||||||
|
Usage: "the goctl home path of the template",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: rpc.RPCTemplate,
|
Action: rpc.RPCTemplate,
|
||||||
},
|
},
|
||||||
|
@ -79,6 +79,12 @@ func RPCNew(c *cli.Context) error {
|
|||||||
// RPCTemplate is the entry for generate rpc template
|
// RPCTemplate is the entry for generate rpc template
|
||||||
func RPCTemplate(c *cli.Context) error {
|
func RPCTemplate(c *cli.Context) error {
|
||||||
protoFile := c.String("o")
|
protoFile := c.String("o")
|
||||||
|
home := c.String("home")
|
||||||
|
|
||||||
|
if len(home) > 0 {
|
||||||
|
util.RegisterGoctlHome(home)
|
||||||
|
}
|
||||||
|
|
||||||
if len(protoFile) == 0 {
|
if len(protoFile) == 0 {
|
||||||
return errors.New("missing -o")
|
return errors.New("missing -o")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user