From baf6b445bbb2439d377dd873b12a9e42d4b52f05 Mon Sep 17 00:00:00 2001 From: real-zony Date: Sun, 30 May 2021 21:26:14 +0800 Subject: [PATCH] Remove the CreateArgs() method that is not used by the base class. --- src/ZonyLrcTools.Cli/Commands/DownloadCommand.cs | 2 -- src/ZonyLrcTools.Cli/Commands/ScanCommand.cs | 6 ------ src/ZonyLrcTools.Cli/Commands/ToolCommand.cs | 9 +++------ src/ZonyLrcTools.Cli/Commands/ToolCommandBase.cs | 2 -- src/ZonyLrcTools.Cli/Commands/UtilityCommand.cs | 3 --- 5 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/ZonyLrcTools.Cli/Commands/DownloadCommand.cs b/src/ZonyLrcTools.Cli/Commands/DownloadCommand.cs index e008132..82ee7f7 100644 --- a/src/ZonyLrcTools.Cli/Commands/DownloadCommand.cs +++ b/src/ZonyLrcTools.Cli/Commands/DownloadCommand.cs @@ -61,8 +61,6 @@ namespace ZonyLrcTools.Cli.Commands #endregion - public override List CreateArgs() => new(); - protected override async Task OnExecuteAsync(CommandLineApplication app) { var files = await ScanMusicFilesAsync(); diff --git a/src/ZonyLrcTools.Cli/Commands/ScanCommand.cs b/src/ZonyLrcTools.Cli/Commands/ScanCommand.cs index cb5efb2..f80dee9 100644 --- a/src/ZonyLrcTools.Cli/Commands/ScanCommand.cs +++ b/src/ZonyLrcTools.Cli/Commands/ScanCommand.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using McMaster.Extensions.CommandLineUtils; @@ -38,10 +37,5 @@ namespace ZonyLrcTools.Cli.Commands _logger.LogInformation($"目录扫描完成,共扫描到 {result.Sum(f => f.FilePaths.Count)} 个音乐文件。"); return 0; } - - public override List CreateArgs() - { - return new(); - } } } \ No newline at end of file diff --git a/src/ZonyLrcTools.Cli/Commands/ToolCommand.cs b/src/ZonyLrcTools.Cli/Commands/ToolCommand.cs index 1b89dd3..bc8d318 100644 --- a/src/ZonyLrcTools.Cli/Commands/ToolCommand.cs +++ b/src/ZonyLrcTools.Cli/Commands/ToolCommand.cs @@ -15,14 +15,11 @@ using ZonyLrcTools.Cli.Infrastructure.Extensions; namespace ZonyLrcTools.Cli.Commands { [Command("lyric-tool")] - [Subcommand(typeof(ScanCommand), typeof(DownloadCommand))] + [Subcommand(typeof(ScanCommand), + typeof(DownloadCommand), + typeof(UtilityCommand))] public class ToolCommand : ToolCommandBase { - public override List CreateArgs() - { - return new(); - } - public static async Task Main(string[] args) { ConfigureLogger(); diff --git a/src/ZonyLrcTools.Cli/Commands/ToolCommandBase.cs b/src/ZonyLrcTools.Cli/Commands/ToolCommandBase.cs index 4ea4b81..d5a175b 100644 --- a/src/ZonyLrcTools.Cli/Commands/ToolCommandBase.cs +++ b/src/ZonyLrcTools.Cli/Commands/ToolCommandBase.cs @@ -7,8 +7,6 @@ namespace ZonyLrcTools.Cli.Commands [HelpOption("--help|-h", Description = "欢迎使用 ZonyLrcToolsX Command Line Interface。")] public abstract class ToolCommandBase { - public abstract List CreateArgs(); - protected virtual Task OnExecuteAsync(CommandLineApplication app) { return Task.FromResult(0); diff --git a/src/ZonyLrcTools.Cli/Commands/UtilityCommand.cs b/src/ZonyLrcTools.Cli/Commands/UtilityCommand.cs index 50eaefb..b4562c0 100644 --- a/src/ZonyLrcTools.Cli/Commands/UtilityCommand.cs +++ b/src/ZonyLrcTools.Cli/Commands/UtilityCommand.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using McMaster.Extensions.CommandLineUtils; @@ -10,8 +9,6 @@ namespace ZonyLrcTools.Cli.Commands [Command("util", Description = "提供常用的工具类功能。")] public class UtilityCommand : ToolCommandBase { - public override List CreateArgs() => new(); - protected override Task OnExecuteAsync(CommandLineApplication app) { return base.OnExecuteAsync(app);