From 65186e9a884944bd7a31e29a328e2333c3971dc5 Mon Sep 17 00:00:00 2001 From: maliming Date: Wed, 15 Jan 2020 09:59:38 +0800 Subject: [PATCH] Output a warning if the command is not found. --- .../Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs index 060bd91cc7..70d5112e95 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs @@ -32,6 +32,13 @@ namespace Volo.Abp.Cli.Commands return Task.CompletedTask; } + if (!AbpCliOptions.Commands.ContainsKey(commandLineArgs.Target)) + { + Logger.LogWarning($"There is no command named {commandLineArgs.Target}."); + Logger.LogInformation(GetUsageInfo()); + return Task.CompletedTask; + } + var commandType = AbpCliOptions.Commands[commandLineArgs.Target]; using (var scope = ServiceScopeFactory.CreateScope())