Table of Contents

Class AsyncAppCommand<TSettings>

Namespace
Ploch.CommandLine.Spectre.Commands
Assembly
Ploch.CommandLine.Spectre.dll

Base class for asynchronous commands that provides common functionality for command execution and validation.

public abstract class AsyncAppCommand<TSettings> : AsyncCommand<TSettings>, ICommand<TSettings>, ICommandLimiter<TSettings>, ICommand where TSettings : CommandSettings

Type Parameters

TSettings

The type of settings the command uses.

Inheritance
AsyncCommand<TSettings>
AsyncAppCommand<TSettings>
Implements
ICommand<TSettings>
ICommandLimiter<TSettings>
ICommand
Derived
Inherited Members

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.

Constructors

AsyncAppCommand(CommandArgumentsRootProcessor, ICommandSettingsValidator<TSettings>, IExceptionHandler, IOutput)

Base class for asynchronous commands that provides common functionality for command execution and validation.

Properties

Output

Gets the output writer used to render command output.

Methods

DoExecuteAsync(CommandContext, TSettings, CancellationToken)

Implements the command's execution logic.

ExecuteAsync(CommandContext, TSettings, CancellationToken)

Executes the command asynchronously with the provided context and settings.

Validate(CommandContext, TSettings)

Validates the command settings using the provided validator.