Constructor AsyncAppCommand
- Namespace
- Ploch.CommandLine.Spectre.Commands
- Assembly
- Ploch.CommandLine.Spectre.dll
AsyncAppCommand(CommandArgumentsRootProcessor, ICommandSettingsValidator<TSettings>, IExceptionHandler, IOutput)
Base class for asynchronous commands that provides common functionality for command execution and validation.
protected AsyncAppCommand(CommandArgumentsRootProcessor settingsProcessor, ICommandSettingsValidator<TSettings> validator, IExceptionHandler exceptionHandler, IOutput output)
Parameters
settingsProcessorCommandArgumentsRootProcessorThe processor applied to the command settings before execution.
validatorICommandSettingsValidator<TSettings>The validator used to validate command settings.
exceptionHandlerIExceptionHandlerThe handler used to process exceptions that occur during command execution.
outputIOutputThe output writer used to render command output.
Remarks
This is the asynchronous counterpart of AppCommand<TSettings> and performs the same framework
work around DoExecuteAsync(CommandContext, TSettings, CancellationToken): it runs the settings processor and routes exceptions to the
IExceptionHandler. It writes nothing to output itself; the "Executing command"
line that announces the command is written to standard error by the application before the command runs.