mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-07-02 05:10:42 +00:00
refactor: Rename main method.
This commit is contained in:
parent
ba3dd5f1bc
commit
ed1974dfbc
@ -7,15 +7,16 @@ using Microsoft.Extensions.DependencyInjection;
|
|||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
using ZonyLrcTools.Cli.Commands;
|
||||||
using ZonyLrcTools.Cli.Infrastructure.DependencyInject;
|
using ZonyLrcTools.Cli.Infrastructure.DependencyInject;
|
||||||
using ZonyLrcTools.Cli.Infrastructure.Exceptions;
|
using ZonyLrcTools.Cli.Infrastructure.Exceptions;
|
||||||
|
|
||||||
namespace ZonyLrcTools.Cli.Commands
|
namespace ZonyLrcTools.Cli
|
||||||
{
|
{
|
||||||
[Command("lyric-tool")]
|
[Command("lyric-tool")]
|
||||||
[Subcommand(typeof(DownloadCommand),
|
[Subcommand(typeof(DownloadCommand),
|
||||||
typeof(UtilityCommand))]
|
typeof(UtilityCommand))]
|
||||||
public class ToolCommand : ToolCommandBase
|
public class Program : ToolCommandBase
|
||||||
{
|
{
|
||||||
public static async Task<int> Main(string[] args)
|
public static async Task<int> Main(string[] args)
|
||||||
{
|
{
|
||||||
@ -78,11 +79,11 @@ namespace ZonyLrcTools.Cli.Commands
|
|||||||
.ConfigureServices((_, services) =>
|
.ConfigureServices((_, services) =>
|
||||||
{
|
{
|
||||||
services.AddSingleton(PhysicalConsole.Singleton);
|
services.AddSingleton(PhysicalConsole.Singleton);
|
||||||
services.BeginAutoDependencyInject<ToolCommand>();
|
services.BeginAutoDependencyInject<Program>();
|
||||||
services.ConfigureConfiguration();
|
services.ConfigureConfiguration();
|
||||||
services.ConfigureToolService();
|
services.ConfigureToolService();
|
||||||
})
|
})
|
||||||
.RunCommandLineApplicationAsync<ToolCommand>(args);
|
.RunCommandLineApplicationAsync<Program>(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int HandleException(Exception ex)
|
private static int HandleException(Exception ex)
|
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using ZonyLrcTools.Cli;
|
||||||
using ZonyLrcTools.Cli.Commands;
|
using ZonyLrcTools.Cli.Commands;
|
||||||
using ZonyLrcTools.Cli.Infrastructure.DependencyInject;
|
using ZonyLrcTools.Cli.Infrastructure.DependencyInject;
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ namespace ZonyLrcTools.Tests
|
|||||||
{
|
{
|
||||||
var service = new ServiceCollection();
|
var service = new ServiceCollection();
|
||||||
|
|
||||||
service.BeginAutoDependencyInject<ToolCommand>();
|
service.BeginAutoDependencyInject<Program>();
|
||||||
service.ConfigureToolService();
|
service.ConfigureToolService();
|
||||||
service.ConfigureConfiguration();
|
service.ConfigureConfiguration();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user