From f17a9b4451578b85c2d0362b0d2b88d888882ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Wed, 31 Jul 2019 18:10:06 +0300 Subject: [PATCH] Enhance CLI help command. --- .../Volo/Abp/Cli/Commands/AddCommandHelper.cs | 9 --------- .../Volo/Abp/Cli/Commands/AddModuleCommand.cs | 4 +++- .../Abp/Cli/Commands/AddPackageCommand.cs | 6 +++++- .../Volo/Abp/Cli/Commands/HelpCommand.cs | 8 +++++++- .../Volo/Abp/Cli/Commands/LoginCommand.cs | 3 +++ .../Volo/Abp/Cli/Commands/NewCommand.cs | 19 +++++++++++++------ .../Volo/Abp/Cli/Commands/UpdateCommand.cs | 10 ++++++---- 7 files changed, 37 insertions(+), 22 deletions(-) delete mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddCommandHelper.cs diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddCommandHelper.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddCommandHelper.cs deleted file mode 100644 index d1b5c9d716..0000000000 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddCommandHelper.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Microsoft.Extensions.Logging; - -namespace Volo.Abp.Cli.Commands -{ - public static class AddCommandHelper - { - - } -} \ No newline at end of file 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 42bc75c864..25feb793b4 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 @@ -53,17 +53,19 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine("It should be used in a folder containing a .sln file."); sb.AppendLine(""); sb.AppendLine("Usage:"); - sb.AppendLine(" abp add-module [-s|--solution]"); + sb.AppendLine(" abp add-module [options]"); sb.AppendLine(""); sb.AppendLine("Options:"); sb.AppendLine(" -s|--solution Specify the solution file explicitly."); sb.AppendLine(" --skip-db-migrations Specify if a new migration will be added or not."); sb.AppendLine(""); sb.AppendLine("Examples:"); + sb.AppendLine(""); sb.AppendLine(" abp add-module Volo.Blogging Adds the module to the current solution."); sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore Adds the module to the given solution."); sb.AppendLine(" abp add-module Volo.Blogging -s Acme.BookStore --skip-db-migrations false Adds the module to the given solution but doesn't create a database migration."); sb.AppendLine(""); + sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); return sb.ToString(); } 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 3b1153eade..211d20d5e1 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 @@ -49,15 +49,19 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine("It should be used in a folder containing a .csproj file."); sb.AppendLine(""); sb.AppendLine("Usage:"); - sb.AppendLine(" abp add-package [-p|--project]"); + sb.AppendLine(""); + sb.AppendLine(" abp add-package [options]"); sb.AppendLine(""); sb.AppendLine("Options:"); + sb.AppendLine(""); sb.AppendLine(" -p|--project Specify the project file explicitly."); sb.AppendLine(""); sb.AppendLine("Examples:"); + sb.AppendLine(""); sb.AppendLine(" abp add-package Volo.Abp.FluentValidation Adds the package to the current project."); sb.AppendLine(" abp add-package Volo.Abp.FluentValidation -p Acme.BookStore.Application Adds the package to the given project."); sb.AppendLine(""); + sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); return sb.ToString(); } 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 c9046f44fb..38e8d075d0 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 @@ -51,6 +51,7 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(" abp [options]"); sb.AppendLine(""); sb.AppendLine("Command List:"); + sb.AppendLine(""); foreach (var command in CliOptions.Commands.ToArray()) { @@ -62,7 +63,7 @@ namespace Volo.Abp.Cli.Commands .GetRequiredService(command.Value)).GetShortDescription(); } - sb.Append(" >"); + sb.Append(" > "); sb.Append(command.Key); sb.Append(string.IsNullOrWhiteSpace(shortDescription) ? "":":"); sb.Append(" "); @@ -70,6 +71,11 @@ namespace Volo.Abp.Cli.Commands } sb.AppendLine(""); + sb.AppendLine("To get a detailed help for a command:"); + sb.AppendLine(""); + sb.AppendLine(" abp help "); + sb.AppendLine(""); + sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); return sb.ToString(); } 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 631756c1e0..4521d1fb86 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 @@ -58,7 +58,10 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(" abp login "); sb.AppendLine(""); sb.AppendLine("Example:"); + sb.AppendLine(""); sb.AppendLine(" abp login john"); + sb.AppendLine(""); + sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); return sb.ToString(); } 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 df8c7eea2c..55e24e14c1 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 @@ -111,26 +111,33 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(""); sb.AppendLine("Usage:"); - sb.AppendLine(" abp new [-t|--template] [-d|--database-provider] [-o|--output-folder]"); + sb.AppendLine(""); + sb.AppendLine(" abp new [options]"); sb.AppendLine(""); sb.AppendLine("Options:"); + sb.AppendLine(""); sb.AppendLine("-t|--template (default: app)"); + sb.AppendLine("-u|--ui (if supported by the template)"); + sb.AppendLine("-d|--database-provider (if supported by the template)"); sb.AppendLine("-o|--output-folder (default: current folder)"); sb.AppendLine("-v|--version (default: latest version)"); - sb.AppendLine("-d|--database-provider (if supported by the template)"); sb.AppendLine("--tiered (if supported by the template)"); sb.AppendLine("--no-ui (if supported by the template)"); + sb.AppendLine("--no-ui (if supported by the template)"); + sb.AppendLine("--separate-identity-server (if supported by the template)"); sb.AppendLine(""); sb.AppendLine("Examples:"); + sb.AppendLine(""); sb.AppendLine(" abp new Acme.BookStore"); sb.AppendLine(" abp new Acme.BookStore --tiered"); + sb.AppendLine(" abp new Acme.BookStore -u angular"); + sb.AppendLine(" abp new Acme.BookStore -u angular -d mongodb"); + sb.AppendLine(" abp new Acme.BookStore -d mongodb"); + sb.AppendLine(" abp new Acme.BookStore -d mongodb -o d:\\my-project"); sb.AppendLine(" abp new Acme.BookStore -t mvc-module"); sb.AppendLine(" abp new Acme.BookStore -t mvc-module no-ui"); - sb.AppendLine(" abp new Acme.BookStore -d mongodb"); - sb.AppendLine(" abp new Acme.BookStore -t mvc -d mongodb"); - sb.AppendLine(" abp new Acme.BookStore -t mvc -d mongodb -o d:\\project"); sb.AppendLine(""); - sb.AppendLine("See the documentation for more info."); + sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); return sb.ToString(); } 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 7ab17d608d..ea061c4bd8 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 @@ -103,16 +103,18 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine(""); sb.AppendLine("Usage:"); - sb.AppendLine(" abp update [-p|--include-previews]"); + sb.AppendLine(""); + sb.AppendLine(" abp update [options]"); sb.AppendLine(""); sb.AppendLine("Options:"); - sb.AppendLine("--include-previews (if supported by the template)"); + sb.AppendLine("-p|--include-previews (if supported by the template)"); sb.AppendLine(""); sb.AppendLine("Some examples:"); + sb.AppendLine(""); sb.AppendLine(" abp update"); - sb.AppendLine(" abp update --include-previews"); + sb.AppendLine(" abp update -p"); sb.AppendLine(""); - sb.AppendLine("See the documentation for more info."); + sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); return sb.ToString(); }