mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 13:28:16 +08:00

committed by
Phil Scott

parent
9502aaf2b9
commit
c2bab0ebf8
@ -59,6 +59,7 @@ namespace Cursor
|
||||
new MultiSelectionPrompt<string>()
|
||||
.PageSize(10)
|
||||
.Title("What are your [green]favorite fruits[/]?")
|
||||
.InstructionsText("[grey](Press [blue]<space>[/] to toggle a fruit, [green]<enter>[/] to accept)[/]")
|
||||
.AddChoices(new[]
|
||||
{
|
||||
"Apple", "Apricot", "Avocado", "Banana", "Blackcurrant", "Blueberry",
|
||||
@ -88,8 +89,8 @@ namespace Cursor
|
||||
|
||||
return AnsiConsole.Prompt(
|
||||
new TextPrompt<string>("What's your [green]favorite sport[/]?")
|
||||
.InvalidChoiceMessage("[red]That's not a valid fruit[/]")
|
||||
.DefaultValue("Lol")
|
||||
.InvalidChoiceMessage("[red]That's not a sport![/]")
|
||||
.DefaultValue("Sport?")
|
||||
.AddChoice("Soccer")
|
||||
.AddChoice("Hockey")
|
||||
.AddChoice("Basketball"));
|
||||
|
Reference in New Issue
Block a user