AskAsync<T>(string, T, CancellationToken) Method

Displays a prompt to the user with a given default.
public static Task<T> AskAsync<T>(string prompt, T defaultValue, CancellationToken cancellationToken = default(CancellationToken))
Namespace
Spectre.Console
Containing Type
AnsiConsole

Parameters

T
The prompt result type.

Parameters

string prompt
The prompt markup text.
T defaultValue
The default value.
CancellationToken cancellationToken
The token to monitor for cancellation requests.

Returns

Task<T>