Class AsyncOptionAction
- Namespace
- Albatross.CommandLine
- Assembly
- Albatross.CommandLine.dll
An asynchronous command line action that wraps a custom async handler function. This action is non-terminating, allowing subsequent actions to execute.
public sealed class AsyncOptionAction : AsynchronousCommandLineAction
- Inheritance
-
AsyncOptionAction
- Inherited Members
Constructors
AsyncOptionAction(Func<ParseResult, CancellationToken, Task<int>>)
Creates a new async option action with the specified handler function.
public AsyncOptionAction(Func<ParseResult, CancellationToken, Task<int>> handler)
Parameters
handlerFunc<ParseResult, CancellationToken, Task<int>>The async function to execute when the action is invoked.
Properties
Terminating
Indicates that the action terminates a command line invocation, and later actions are skipped.
public override bool Terminating { get; }
Property Value
Methods
InvokeAsync(ParseResult, CancellationToken)
Performs an action when the associated symbol is invoked on the command line.
public override Task<int> InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken = default)
Parameters
parseResultParseResultProvides the parse results.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.