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
TOptionThe type of the option being handled.
TContextValueThe 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
symbolTOptionThe option being processed.
resultParseResultThe parse result containing the option's value.
cancellationTokenCancellationTokenA 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.