Browse Source

Enhance CLI help command.

pull/1564/head
Halil İbrahim Kalkan 7 years ago
parent
commit
f17a9b4451
  1. 9
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddCommandHelper.cs
  2. 4
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddModuleCommand.cs
  3. 6
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddPackageCommand.cs
  4. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs
  5. 3
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs
  6. 19
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  7. 10
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs

9
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/AddCommandHelper.cs

@ -1,9 +0,0 @@
using Microsoft.Extensions.Logging;
namespace Volo.Abp.Cli.Commands
{
public static class AddCommandHelper
{
}
}

4
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 <module-name> [-s|--solution]");
sb.AppendLine(" abp add-module <module-name> [options]");
sb.AppendLine("");
sb.AppendLine("Options:");
sb.AppendLine(" -s|--solution <solution-file> Specify the solution file explicitly.");
sb.AppendLine(" --skip-db-migrations <boolean> 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();
}

6
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 <package-name> [-p|--project]");
sb.AppendLine("");
sb.AppendLine(" abp add-package <package-name> [options]");
sb.AppendLine("");
sb.AppendLine("Options:");
sb.AppendLine("");
sb.AppendLine(" -p|--project <project-file> 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();
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs

@ -51,6 +51,7 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" abp <command> <target> [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 <command>");
sb.AppendLine("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");
return sb.ToString();
}

3
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 <username>");
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();
}

19
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 <project-name> [-t|--template] [-d|--database-provider] [-o|--output-folder]");
sb.AppendLine("");
sb.AppendLine(" abp new <project-name> [options]");
sb.AppendLine("");
sb.AppendLine("Options:");
sb.AppendLine("");
sb.AppendLine("-t|--template <template-name> (default: app)");
sb.AppendLine("-u|--ui <ui-framework> (if supported by the template)");
sb.AppendLine("-d|--database-provider <database-provider> (if supported by the template)");
sb.AppendLine("-o|--output-folder <output-folder> (default: current folder)");
sb.AppendLine("-v|--version <version> (default: latest version)");
sb.AppendLine("-d|--database-provider <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();
}

10
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();
}

Loading…
Cancel
Save