Remove the CreateArgs() method that is not used by the base class.

This commit is contained in:
real-zony 2021-05-30 21:26:14 +08:00
parent 79e1a0d300
commit baf6b445bb
5 changed files with 3 additions and 19 deletions

View File

@ -61,8 +61,6 @@ namespace ZonyLrcTools.Cli.Commands
#endregion #endregion
public override List<string> CreateArgs() => new();
protected override async Task<int> OnExecuteAsync(CommandLineApplication app) protected override async Task<int> OnExecuteAsync(CommandLineApplication app)
{ {
var files = await ScanMusicFilesAsync(); var files = await ScanMusicFilesAsync();

View File

@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using McMaster.Extensions.CommandLineUtils; using McMaster.Extensions.CommandLineUtils;
@ -38,10 +37,5 @@ namespace ZonyLrcTools.Cli.Commands
_logger.LogInformation($"目录扫描完成,共扫描到 {result.Sum(f => f.FilePaths.Count)} 个音乐文件。"); _logger.LogInformation($"目录扫描完成,共扫描到 {result.Sum(f => f.FilePaths.Count)} 个音乐文件。");
return 0; return 0;
} }
public override List<string> CreateArgs()
{
return new();
}
} }
} }

View File

@ -15,14 +15,11 @@ using ZonyLrcTools.Cli.Infrastructure.Extensions;
namespace ZonyLrcTools.Cli.Commands namespace ZonyLrcTools.Cli.Commands
{ {
[Command("lyric-tool")] [Command("lyric-tool")]
[Subcommand(typeof(ScanCommand), typeof(DownloadCommand))] [Subcommand(typeof(ScanCommand),
typeof(DownloadCommand),
typeof(UtilityCommand))]
public class ToolCommand : ToolCommandBase public class ToolCommand : ToolCommandBase
{ {
public override List<string> CreateArgs()
{
return new();
}
public static async Task<int> Main(string[] args) public static async Task<int> Main(string[] args)
{ {
ConfigureLogger(); ConfigureLogger();

View File

@ -7,8 +7,6 @@ namespace ZonyLrcTools.Cli.Commands
[HelpOption("--help|-h", Description = "欢迎使用 ZonyLrcToolsX Command Line Interface。")] [HelpOption("--help|-h", Description = "欢迎使用 ZonyLrcToolsX Command Line Interface。")]
public abstract class ToolCommandBase public abstract class ToolCommandBase
{ {
public abstract List<string> CreateArgs();
protected virtual Task<int> OnExecuteAsync(CommandLineApplication app) protected virtual Task<int> OnExecuteAsync(CommandLineApplication app)
{ {
return Task.FromResult(0); return Task.FromResult(0);

View File

@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using McMaster.Extensions.CommandLineUtils; using McMaster.Extensions.CommandLineUtils;
@ -10,8 +9,6 @@ namespace ZonyLrcTools.Cli.Commands
[Command("util", Description = "提供常用的工具类功能。")] [Command("util", Description = "提供常用的工具类功能。")]
public class UtilityCommand : ToolCommandBase public class UtilityCommand : ToolCommandBase
{ {
public override List<string> CreateArgs() => new();
protected override Task<int> OnExecuteAsync(CommandLineApplication app) protected override Task<int> OnExecuteAsync(CommandLineApplication app)
{ {
return base.OnExecuteAsync(app); return base.OnExecuteAsync(app);