Constructor AppCommand
- Namespace
- Ploch.CommandLine.Spectre.Commands
- Assembly
- Ploch.CommandLine.Spectre.dll
AppCommand(CommandArgumentsRootProcessor, ICommandSettingsValidator<TSettings>, IExceptionHandler, IOutput)
Base class for application commands that provides common functionality for command execution and validation.
protected AppCommand(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 synchronous counterpart of AsyncAppCommand<TSettings> and performs the same framework
work around DoExecute(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.