From ed1974dfbcff3f6726575b4b572b178bed52cfa8 Mon Sep 17 00:00:00 2001 From: real-zony Date: Fri, 11 Feb 2022 11:52:35 +0800 Subject: [PATCH] refactor: Rename main method. --- .../{Commands/ToolCommand.cs => Program.cs} | 9 +++++---- tests/ZonyLrcTools.Tests/TestBase.cs | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) rename src/ZonyLrcTools.Cli/{Commands/ToolCommand.cs => Program.cs} (93%) diff --git a/src/ZonyLrcTools.Cli/Commands/ToolCommand.cs b/src/ZonyLrcTools.Cli/Program.cs similarity index 93% rename from src/ZonyLrcTools.Cli/Commands/ToolCommand.cs rename to src/ZonyLrcTools.Cli/Program.cs index 64a64fe..db097c9 100644 --- a/src/ZonyLrcTools.Cli/Commands/ToolCommand.cs +++ b/src/ZonyLrcTools.Cli/Program.cs @@ -7,15 +7,16 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Serilog; using Serilog.Events; +using ZonyLrcTools.Cli.Commands; using ZonyLrcTools.Cli.Infrastructure.DependencyInject; using ZonyLrcTools.Cli.Infrastructure.Exceptions; -namespace ZonyLrcTools.Cli.Commands +namespace ZonyLrcTools.Cli { [Command("lyric-tool")] [Subcommand(typeof(DownloadCommand), typeof(UtilityCommand))] - public class ToolCommand : ToolCommandBase + public class Program : ToolCommandBase { public static async Task Main(string[] args) { @@ -78,11 +79,11 @@ namespace ZonyLrcTools.Cli.Commands .ConfigureServices((_, services) => { services.AddSingleton(PhysicalConsole.Singleton); - services.BeginAutoDependencyInject(); + services.BeginAutoDependencyInject(); services.ConfigureConfiguration(); services.ConfigureToolService(); }) - .RunCommandLineApplicationAsync(args); + .RunCommandLineApplicationAsync(args); } private static int HandleException(Exception ex) diff --git a/tests/ZonyLrcTools.Tests/TestBase.cs b/tests/ZonyLrcTools.Tests/TestBase.cs index a005a46..ae7de87 100644 --- a/tests/ZonyLrcTools.Tests/TestBase.cs +++ b/tests/ZonyLrcTools.Tests/TestBase.cs @@ -1,5 +1,6 @@ using System; using Microsoft.Extensions.DependencyInjection; +using ZonyLrcTools.Cli; using ZonyLrcTools.Cli.Commands; using ZonyLrcTools.Cli.Infrastructure.DependencyInject; @@ -20,7 +21,7 @@ namespace ZonyLrcTools.Tests { var service = new ServiceCollection(); - service.BeginAutoDependencyInject(); + service.BeginAutoDependencyInject(); service.ConfigureToolService(); service.ConfigureConfiguration();