feat: 完成2.0重构
This commit is contained in:
@@ -14,10 +14,9 @@ namespace Yi.Abp.Tool.Commands
|
|||||||
public string? Description { get; }
|
public string? Description { get; }
|
||||||
public void CommandLineApplication(CommandLineApplication application)
|
public void CommandLineApplication(CommandLineApplication application)
|
||||||
{
|
{
|
||||||
var modulePathOption= application.Option("-modulePath", "模块路径",CommandOptionType.SingleValue);
|
var modulePathOption= application.Option("-p|--modulePath", "模块路径",CommandOptionType.SingleValue);
|
||||||
var solutionOption= application.Option("-s|--solution", "解决方案路径",CommandOptionType.SingleValue);
|
var solutionOption= application.Option("-s|--solution", "解决方案路径",CommandOptionType.SingleValue);
|
||||||
var moduleNameArgument = application.Argument("moduleName", "模块名", null);
|
var moduleNameArgument = application.Argument("moduleName", "模块名", (_) => { });
|
||||||
|
|
||||||
application.OnExecute(() =>
|
application.OnExecute(() =>
|
||||||
{
|
{
|
||||||
var modulePath = "";
|
var modulePath = "";
|
||||||
|
|||||||
@@ -26,11 +26,13 @@ namespace Yi.Abp.Tool.Commands
|
|||||||
|
|
||||||
public void CommandLineApplication(CommandLineApplication application)
|
public void CommandLineApplication(CommandLineApplication application)
|
||||||
{
|
{
|
||||||
var templateTypeOption = application.Option("-t", "模板类型", CommandOptionType.SingleValue);
|
var templateTypeOption = application.Option("-t|--moduleType", "模板类型", CommandOptionType.SingleValue);
|
||||||
var csfOption = application.Option("csf", "是否创建解决方案", CommandOptionType.SingleValue);
|
var csfOption = application.Option("-csf", "是否创建解决方案", CommandOptionType.SingleValue);
|
||||||
var moduleNameArgument = application.Argument("moduleName", "模块名", null);
|
var moduleNameArgument = application.Argument("moduleName", "模块名", (_) => { });
|
||||||
|
|
||||||
|
|
||||||
|
application.OnExecute(() =>
|
||||||
|
{
|
||||||
#region 处理生成类型
|
#region 处理生成类型
|
||||||
|
|
||||||
var id = Guid.NewGuid().ToString("N");
|
var id = Guid.NewGuid().ToString("N");
|
||||||
@@ -85,6 +87,8 @@ namespace Yi.Abp.Tool.Commands
|
|||||||
File.Delete(zipPath);
|
File.Delete(zipPath);
|
||||||
|
|
||||||
Console.WriteLine("恭喜~模块已生成!");
|
Console.WriteLine("恭喜~模块已生成!");
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,11 +20,13 @@ class Program
|
|||||||
// args = ["clear", "-path", "D:\\code\\csharp\\source\\Yi\\Yi.Abp.Net8\\src"];
|
// args = ["clear", "-path", "D:\\code\\csharp\\source\\Yi\\Yi.Abp.Net8\\src"];
|
||||||
|
|
||||||
//帮助
|
//帮助
|
||||||
args = ["-h"];
|
//args = ["-h"];
|
||||||
//版本
|
//版本
|
||||||
// args = ["-v"];
|
// args = ["-v"];
|
||||||
//清理
|
//清理
|
||||||
// args = ["clear"];
|
// args = ["clear"];
|
||||||
|
//添加模块
|
||||||
|
args = ["add-module", "kkk"];
|
||||||
#endif
|
#endif
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user