Table of Contents

Interface IAsyncOptionHandler<TOption, TContextValue>

Namespace
Albatross.CommandLine
Assembly
Albatross.CommandLine.dll

Handler for processing command options that returns a value to be stored in the command context. The returned value is automatically stored and can be retrieved by subsequent handlers or the command handler.

public interface IAsyncOptionHandler<in TOption, TContextValue> where TOption : Option where TContextValue : notnull

Type Parameters

TOption

The type of the option being handled.

TContextValue

The type of the value to store in the context.

Methods

InvokeAsync(TOption, ParseResult, CancellationToken)

Processes the option asynchronously and returns a result to store in the context.

Task<OptionHandlerResult<TContextValue>> InvokeAsync(TOption symbol, ParseResult result, CancellationToken cancellationToken)

Parameters

symbol TOption

The option being processed.

result ParseResult

The parse result containing the option's value.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<OptionHandlerResult<TContextValue>>

A result containing the value to store, or an empty result if no value should be stored.