mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Rename CommandHelpTextRenderer to HelpTextRenderer
This commit is contained in:
@@ -23,14 +23,14 @@ namespace CliFx
|
||||
private readonly ICommandSchemaResolver _commandSchemaResolver;
|
||||
private readonly ICommandFactory _commandFactory;
|
||||
private readonly ICommandInitializer _commandInitializer;
|
||||
private readonly ICommandHelpTextRenderer _commandHelpTextRenderer;
|
||||
private readonly IHelpTextRenderer _helpTextRenderer;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes an instance of <see cref="CliApplication"/>.
|
||||
/// </summary>
|
||||
public CliApplication(ApplicationMetadata metadata, ApplicationConfiguration configuration,
|
||||
IConsole console, ICommandInputParser commandInputParser, ICommandSchemaResolver commandSchemaResolver,
|
||||
ICommandFactory commandFactory, ICommandInitializer commandInitializer, ICommandHelpTextRenderer commandHelpTextRenderer)
|
||||
ICommandFactory commandFactory, ICommandInitializer commandInitializer, IHelpTextRenderer helpTextRenderer)
|
||||
{
|
||||
_metadata = metadata.GuardNotNull(nameof(metadata));
|
||||
_configuration = configuration.GuardNotNull(nameof(configuration));
|
||||
@@ -40,7 +40,7 @@ namespace CliFx
|
||||
_commandSchemaResolver = commandSchemaResolver.GuardNotNull(nameof(commandSchemaResolver));
|
||||
_commandFactory = commandFactory.GuardNotNull(nameof(commandFactory));
|
||||
_commandInitializer = commandInitializer.GuardNotNull(nameof(commandInitializer));
|
||||
_commandHelpTextRenderer = commandHelpTextRenderer.GuardNotNull(nameof(commandHelpTextRenderer));
|
||||
_helpTextRenderer = helpTextRenderer.GuardNotNull(nameof(helpTextRenderer));
|
||||
}
|
||||
|
||||
private IReadOnlyList<string> GetAvailableCommandSchemasValidationErrors(IReadOnlyList<CommandSchema> availableCommandSchemas)
|
||||
@@ -170,7 +170,7 @@ namespace CliFx
|
||||
|
||||
// Show help
|
||||
var helpTextSource = new HelpTextSource(_metadata, availableCommandSchemas, parentCommandSchema);
|
||||
_commandHelpTextRenderer.RenderHelpText(_console, helpTextSource);
|
||||
_helpTextRenderer.RenderHelpText(_console, helpTextSource);
|
||||
|
||||
return isError ? -1 : 0;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ namespace CliFx
|
||||
if (commandInput.IsHelpRequested())
|
||||
{
|
||||
var helpTextSource = new HelpTextSource(_metadata, availableCommandSchemas, matchingCommandSchema);
|
||||
_commandHelpTextRenderer.RenderHelpText(_console, helpTextSource);
|
||||
_helpTextRenderer.RenderHelpText(_console, helpTextSource);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace CliFx
|
||||
|
||||
return new CliApplication(metadata, configuration,
|
||||
_console, new CommandInputParser(), new CommandSchemaResolver(),
|
||||
_commandFactory, new CommandInitializer(), new CommandHelpTextRenderer());
|
||||
_commandFactory, new CommandInitializer(), new HelpTextRenderer());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,9 @@ using CliFx.Models;
|
||||
namespace CliFx.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation of <see cref="ICommandHelpTextRenderer"/>.
|
||||
/// Default implementation of <see cref="IHelpTextRenderer"/>.
|
||||
/// </summary>
|
||||
public partial class CommandHelpTextRenderer : ICommandHelpTextRenderer
|
||||
public partial class HelpTextRenderer : IHelpTextRenderer
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void RenderHelpText(IConsole console, HelpTextSource source)
|
||||
@@ -280,7 +280,7 @@ namespace CliFx.Services
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CommandHelpTextRenderer
|
||||
public partial class HelpTextRenderer
|
||||
{
|
||||
private static string GetRelativeCommandName(CommandSchema commandSchema, CommandSchema parentCommandSchema) =>
|
||||
parentCommandSchema.Name.IsNullOrWhiteSpace()
|
||||
@@ -5,7 +5,7 @@ namespace CliFx.Services
|
||||
/// <summary>
|
||||
/// Renders help text to the console.
|
||||
/// </summary>
|
||||
public interface ICommandHelpTextRenderer
|
||||
public interface IHelpTextRenderer
|
||||
{
|
||||
/// <summary>
|
||||
/// Renders help text using specified console and source information.
|
||||
Reference in New Issue
Block a user