feat: 完成2.0重构

This commit is contained in:
橙子
2024-11-05 22:22:42 +08:00
parent d83db53acb
commit a87d6345c2
3 changed files with 64 additions and 59 deletions

View File

@@ -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 = "";

View File

@@ -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;
});
} }
} }
} }

View File

@@ -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
{ {