ShaunLawrie / PwshSpectreConsole

👻 PwshSpectreConsole is a PowerShell wrapper for the awesome Spectre.Console library
https://pwshspectreconsole.com/
MIT License
114 stars 7 forks source link

Add choices to Read-SpectraText #22

Closed csillikd closed 9 months ago

csillikd commented 9 months ago

Add the missing Choices parameter to Read-SpectraText.

Usage: Read-SpectreText -Question "Really?" -DefaultAnswer "y" -Choices @('y', 'n')

Appears: Really? [y/n] (y):

ShaunLawrie commented 9 months ago

For the y/n scenario there is also https://github.com/ShaunLawrie/PwshSpectreConsole/blob/prerelease/PwshSpectreConsole/public/prompts/Read-SpectreConfirm.ps1

This could do with having the choice option exposed though thanks.

Once this is merged it will be in prerelease for a couple of weeks while I'm away from the computer. You'll be able to install the prerelease module with install-module PwshSpectreConsole -AllowPrerelease (or update-module -allowprerelease)

csillikd commented 9 months ago

Thx @ShaunLawrie! I know the Confirm, but I needed something like [y/n/q/?] (y), similar to git add --patch