Table of Contents

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

handler Func<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

bool

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

parseResult ParseResult

Provides the parse results.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<int>

A value that can be used as the exit code for the process.