feat: Add --remote (#1387)

Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
anqiansong
2021-12-29 18:16:42 +08:00
committed by GitHub
parent 23deaf50e6
commit b8ea16a88e
12 changed files with 265 additions and 31 deletions

View File

@@ -54,8 +54,15 @@ var commands = []cli.Command{
Usage: "the output api file",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: apigen.ApiCommand,
@@ -66,8 +73,15 @@ var commands = []cli.Command{
Action: new.CreateServiceCommand,
Flags: []cli.Flag{
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
cli.StringFlag{
Name: "style",
@@ -138,8 +152,15 @@ var commands = []cli.Command{
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: gogen.GoCommand,
@@ -259,8 +280,15 @@ var commands = []cli.Command{
Value: 0,
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
cli.StringFlag{
Name: "version",
@@ -352,8 +380,15 @@ var commands = []cli.Command{
Value: 10,
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: kube.DeploymentCommand,
@@ -377,8 +412,15 @@ var commands = []cli.Command{
Usage: "whether the command execution environment is from idea plugin. [optional]",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: rpc.RPCNew,
@@ -392,8 +434,15 @@ var commands = []cli.Command{
Usage: "the target path of proto",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time," +
" if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: rpc.RPCTemplate,
@@ -427,8 +476,15 @@ var commands = []cli.Command{
Usage: "whether the command execution environment is from idea plugin. [optional]",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: rpc.RPC,
@@ -472,8 +528,15 @@ var commands = []cli.Command{
Usage: "the name of database [optional]",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: model.MysqlDDL,
@@ -507,8 +570,15 @@ var commands = []cli.Command{
Usage: "for idea plugin [optional]",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: model.MySqlDataSource,
@@ -552,8 +622,15 @@ var commands = []cli.Command{
Usage: "for idea plugin [optional]",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: model.PostgreSqlDataSource,
@@ -581,8 +658,15 @@ var commands = []cli.Command{
Usage: "the file naming format, see [https://github.com/tal-tech/go-zero/tree/master/tools/goctl/config/readme.md]",
},
cli.StringFlag{
Name: "home",
Usage: "the goctl home path of the template",
Name: "home",
Usage: "the goctl home path of the template, --home and --remote cannot be set at the same time," +
" if they are, --remote has higher priority",
},
cli.StringFlag{
Name: "remote",
Usage: "the remote git repo of the template, --home and --remote cannot be set at the same time, " +
"if they are, --remote has higher priority\n\tThe git repo directory must be consistent with the " +
"https://github.com/zeromicro/go-zero-template directory structure",
},
},
Action: mongo.Action,