goctl api new should given a service_name explictly (#1688)

This commit is contained in:
fang duan
2022-04-17 20:59:18 +08:00
committed by GitHub
parent 4382ec0e0d
commit fadef0ccd9
2 changed files with 8 additions and 6 deletions

View File

@@ -20,11 +20,12 @@ var apiTemplate string
// CreateServiceCommand fast create service
func CreateServiceCommand(c *cli.Context) error {
if c.NArg() == 0 {
cli.ShowCommandHelpAndExit(c, "new", 1)
}
args := c.Args()
dirName := args.First()
if len(dirName) == 0 {
dirName = "greet"
}
dirStyle := c.String("style")
if len(dirStyle) == 0 {