feat: 完成tool搭建

This commit is contained in:
橙子
2024-11-05 22:12:30 +08:00
parent c944bd3b0e
commit d83db53acb
8 changed files with 352 additions and 336 deletions

View File

@@ -23,22 +23,23 @@ namespace Yi.Abp.Tool
private void InitCommand()
{
Application.HelpOption("-h");
Application.HelpOption("-h|--help");
Application.VersionOption("-v|--versions","1.0.0");
foreach (var command in _commands)
{
Application.Command(command.Command, con => command.CommandLineApplicationAsync(con).Wait());
CommandLineApplication childrenCommandLineApplication = new CommandLineApplication(true)
{
Name = command.Command,
Parent = Application,
Description =command.Description
};
Application.Commands.Add(childrenCommandLineApplication);
command.CommandLineApplication(childrenCommandLineApplication);
}
}
public async Task InvokerAsync(string[] args)
{
//使用哪个命令根据第一参数来判断如果都不是打印help
// foreach (var commandLineApplication in Application.Commands)
// {
// commandLineApplication.Execute(args);
// }
Application.Execute(args);
}
}