add goctl rpc template home flag (#871)

Co-authored-by: suzhenpeng <suzhenpeng@ecoplants.tech>
This commit is contained in:
neosu
2021-08-04 15:54:43 +08:00
committed by GitHub
parent 6793f7a1de
commit 00061c2e5b
2 changed files with 10 additions and 0 deletions

View File

@@ -79,6 +79,12 @@ func RPCNew(c *cli.Context) error {
// RPCTemplate is the entry for generate rpc template
func RPCTemplate(c *cli.Context) error {
protoFile := c.String("o")
home := c.String("home")
if len(home) > 0 {
util.RegisterGoctlHome(home)
}
if len(protoFile) == 0 {
return errors.New("missing -o")
}