diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs index 9a897bdb533..803f208d8a1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs @@ -144,7 +144,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Add a multi-package module to a solution by finding all packages of the module, " + "finding related projects in the solution and adding each package to the corresponding project in the solution."; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs index da6ca8a3565..f2197fa5964 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs @@ -110,7 +110,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Add a new ABP package to a project by adding related NuGet package dependencies and [DependsOn(...)] attributes."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BuildCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BuildCommand.cs index c080e29daad..a70c115c735 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BuildCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BuildCommand.cs @@ -108,7 +108,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Builds a dotnet repository and dependent repositories or a solution."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BundleCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BundleCommand.cs index efacce1bc86..c0b6c0f9651 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BundleCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/BundleCommand.cs @@ -45,7 +45,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs) await BundlingService.BundleAsync(workingDirectory, forceBuild, projectType); } - public string GetShortDescription() + public static string GetShortDescription() { return "Bundles all third party styles and scripts required by modules and updates index.html file."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CleanCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CleanCommand.cs index 384343f758e..71964653a7b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CleanCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CleanCommand.cs @@ -57,7 +57,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Delete all BIN and OBJ folders in current folder."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ClearDownloadCacheCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ClearDownloadCacheCommand.cs index cb489f00fb2..e31b40ed284 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ClearDownloadCacheCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ClearDownloadCacheCommand.cs @@ -52,7 +52,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Clears the templates download cache."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CliCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CliCommand.cs index 46c1fc65dbc..872f0071962 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CliCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CliCommand.cs @@ -150,7 +150,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Update or remove ABP CLI. See https://abp.io/docs/latest/cli"; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigratorCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigratorCommand.cs index 05abd4940cd..fcdbe094aae 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigratorCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/CreateMigrationAndRunMigratorCommand.cs @@ -85,7 +85,7 @@ public string GetUsageInfo() return string.Empty; } - public string GetShortDescription() + public static string GetShortDescription() { return string.Empty; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs index eb8d5256ae0..22846185ac1 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs @@ -34,7 +34,7 @@ public override string GetUsageInfo() return sb.ToString(); } - public override string GetShortDescription() + public static string GetShortDescription() { return "Generates client service proxies and DTOs to consume HTTP APIs."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs index 60532b7e7da..34bb26e5788 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GetSourceCommand.cs @@ -105,7 +105,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Download the source code of the specified module."; } 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 a1ce5cb5bcb..5b6c80d3be7 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 @@ -1,4 +1,5 @@ using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; @@ -66,13 +67,13 @@ public string GetUsageInfo() foreach (var command in AbpCliOptions.Commands.ToArray()) { - string shortDescription; - - using (var scope = ServiceScopeFactory.CreateScope()) + var method = command.Value.GetMethod("GetShortDescription", BindingFlags.Static | BindingFlags.Public); + if (method == null) { - shortDescription = ((IConsoleCommand)scope.ServiceProvider - .GetRequiredService(command.Value)).GetShortDescription(); + continue; } + + var shortDescription = (string) method.Invoke(null, null); sb.Append(" > "); sb.Append(command.Key); @@ -91,7 +92,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Show command line help. Write ` abp help `"; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/IConsoleCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/IConsoleCommand.cs index 6b9151384bb..93dbe815700 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/IConsoleCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/IConsoleCommand.cs @@ -8,6 +8,4 @@ public interface IConsoleCommand Task ExecuteAsync(CommandLineArgs commandLineArgs); string GetUsageInfo(); - - string GetShortDescription(); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/InstallLibsCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/InstallLibsCommand.cs index 400f5a32c06..0136b635ec2 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/InstallLibsCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/InstallLibsCommand.cs @@ -63,7 +63,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Install NPM Packages for MVC / Razor Pages and Blazor Server UI types."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs index a0a374a89a1..47c1ac78f4e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/Internal/RecreateInitialMigrationCommand.cs @@ -82,7 +82,7 @@ public string GetUsageInfo() return GetShortDescription(); } - public string GetShortDescription() + public static string GetShortDescription() { return "This is a internal command. Please run 'abp recreate-initial-migration' command in abp or volo root directory."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListModulesCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListModulesCommand.cs index cef190b1530..af685102d8f 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListModulesCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListModulesCommand.cs @@ -72,7 +72,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "List open source application modules"; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListTemplatesCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListTemplatesCommand.cs index 09ce5edeaff..8f8f598de47 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListTemplatesCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ListTemplatesCommand.cs @@ -99,7 +99,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Lists available templates to be created."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs index 3c58a67e877..477e0222c5a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs @@ -188,7 +188,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Sign in to " + CliUrls.AccountAbpIo + "."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginInfoCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginInfoCommand.cs index 82fbbbdf31c..c7fc8eff309 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginInfoCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginInfoCommand.cs @@ -62,7 +62,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Show your login info."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LogoutCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LogoutCommand.cs index ed571dd7b4c..2dcb08ea9ba 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LogoutCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LogoutCommand.cs @@ -31,7 +31,7 @@ public string GetUsageInfo() return string.Empty; } - public string GetShortDescription() + public static string GetShortDescription() { return "Sign out from " + CliUrls.AccountAbpIo + "."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs index cde8dcb42c5..5d228cc176e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs @@ -237,7 +237,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Generate a new solution based on the ABP startup templates."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/PromptCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/PromptCommand.cs index 3fd8a0f25fb..146ff557b4a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/PromptCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/PromptCommand.cs @@ -27,7 +27,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Starts with prompt mode."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs index 662397dc3b9..425242ed70c 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProxyCommandBase.cs @@ -119,8 +119,6 @@ public virtual string GetUsageInfo() return sb.ToString(); } - public abstract string GetShortDescription(); - public static class Options { public static class Module diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs index 3372584f1a5..046727d2593 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/RemoveProxyCommand.cs @@ -33,7 +33,7 @@ public override string GetUsageInfo() return sb.ToString(); } - public override string GetShortDescription() + public static string GetShortDescription() { return "Remove client service proxies and DTOs to consume HTTP APIs."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs index d519a2dabcc..f7423975036 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs @@ -576,7 +576,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Install, update, remove or start ABP Suite. See https://abp.io/suite."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToLocalCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToLocalCommand.cs index f0c8ec28925..b0889e9557e 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToLocalCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToLocalCommand.cs @@ -78,7 +78,7 @@ private string GetWorkingDirectory(CommandLineArgs commandLineArgs) return path; } - public string GetShortDescription() + public static string GetShortDescription() { return "Changes all NuGet package references to local project references for all the .csproj files in the specified folder" + " (and all its subfolders with any deep)"; diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToNightlyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToNightlyCommand.cs index e1b90986bd8..b7dca40bad4 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToNightlyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToNightlyCommand.cs @@ -38,7 +38,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Switches packages to nightly preview ABP version."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreRcCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreRcCommand.cs index bc04ab48b1c..eab2df75c8a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreRcCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreRcCommand.cs @@ -38,7 +38,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Switches npm packages to pre-rc ABP version."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreviewCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreviewCommand.cs index 691914d5a8f..aab29150c09 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreviewCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToPreviewCommand.cs @@ -38,7 +38,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Switches packages to preview ABP version."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToStableCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToStableCommand.cs index 1a5162b65ad..9c7d03fc705 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToStableCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SwitchToStableCommand.cs @@ -38,7 +38,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Switches packages to stable ABP version from preview version."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs index b15fb8c653f..bf059e5e56b 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs @@ -555,7 +555,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Mainly used to translate ABP's resources (JSON files) easier."; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs index c45a2f396fe..ad0992af4ec 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs @@ -132,7 +132,7 @@ public string GetUsageInfo() return sb.ToString(); } - public string GetShortDescription() + public static string GetShortDescription() { return "Update all ABP related NuGet packages and NPM packages in a solution or project to the latest version."; }