|
|
|
@ -1,6 +1,8 @@ |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Microsoft.Extensions.Logging.Abstractions; |
|
|
|
using Microsoft.Extensions.Options; |
|
|
|
using Volo.Abp.Cli.Args; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
|
|
|
|
@ -9,10 +11,12 @@ namespace Volo.Abp.Cli.Commands |
|
|
|
public class HelpCommand : IConsoleCommand, ITransientDependency |
|
|
|
{ |
|
|
|
public ILogger<HelpCommand> Logger { get; set; } |
|
|
|
protected CliOptions CliOptions { get; } |
|
|
|
|
|
|
|
public HelpCommand() |
|
|
|
public HelpCommand(IOptions<CliOptions> cliOptions) |
|
|
|
{ |
|
|
|
Logger = NullLogger<HelpCommand>.Instance; |
|
|
|
CliOptions = cliOptions.Value; |
|
|
|
} |
|
|
|
|
|
|
|
public Task ExecuteAsync(CommandLineArgs commandLineArgs) |
|
|
|
@ -20,10 +24,16 @@ namespace Volo.Abp.Cli.Commands |
|
|
|
Logger.LogInformation(""); |
|
|
|
Logger.LogInformation("Usage:"); |
|
|
|
Logger.LogInformation(""); |
|
|
|
Logger.LogInformation(" abp <command> <target> [options]"); |
|
|
|
Logger.LogInformation(" abp <command> <target> [options]"); |
|
|
|
Logger.LogInformation(""); |
|
|
|
Logger.LogInformation("Command List:"); |
|
|
|
|
|
|
|
//TODO: Write available commands (not hard-coded, but from the CliOptions.Commands)
|
|
|
|
foreach (var commandKey in CliOptions.Commands.Keys.ToArray()) |
|
|
|
{ |
|
|
|
Logger.LogInformation(" " + commandKey); |
|
|
|
} |
|
|
|
|
|
|
|
Logger.LogInformation(""); |
|
|
|
|
|
|
|
return Task.CompletedTask; |
|
|
|
} |
|
|
|
|