Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Spectre.Console/Prompts/ConfirmationPrompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public sealed class ConfirmationPrompt : IPrompt<bool>
/// </summary>
public bool ShowDefaultValue { get; set; } = true;

/// <summary>
/// Gets or sets a value indicating whether the confirmation
/// should use case insensitive matching.
/// </summary>
public bool CaseInsensitive { get; set; } = true;

/// <summary>
/// Initializes a new instance of the <see cref="ConfirmationPrompt"/> class.
/// </summary>
Expand Down Expand Up @@ -67,6 +73,7 @@ public async Task<bool> ShowAsync(IAnsiConsole console, CancellationToken cancel
.AddChoice(No);

var result = await prompt.ShowAsync(console, cancellationToken).ConfigureAwait(false);
return result == Yes;

return Yes.ToString().Equals(result.ToString(), CaseInsensitive ? StringComparison.CurrentCultureIgnoreCase : StringComparison.CurrentCulture);
}
}