Table of Contents

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

settingsProcessor CommandArgumentsRootProcessor

The processor applied to the command settings before execution.

validator ICommandSettingsValidator<TSettings>

The validator used to validate command settings.

exceptionHandler IExceptionHandler

The handler used to process exceptions that occur during command execution.

output IOutput

The 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.