diff --git a/src/Spectre.Console/Prompts/ConfirmationPrompt.cs b/src/Spectre.Console/Prompts/ConfirmationPrompt.cs index 9a17bd3..bedfb2e 100644 --- a/src/Spectre.Console/Prompts/ConfirmationPrompt.cs +++ b/src/Spectre.Console/Prompts/ConfirmationPrompt.cs @@ -39,6 +39,12 @@ public sealed class ConfirmationPrompt : IPrompt /// public bool ShowDefaultValue { get; set; } = true; + /// + /// Gets or sets a value indicating whether the confirmation + /// should use case insensitive matching. + /// + public bool CaseInsensitive { get; set; } = true; + /// /// Initializes a new instance of the class. /// @@ -67,6 +73,7 @@ public sealed class ConfirmationPrompt : IPrompt .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); } } \ No newline at end of file