For some reason it wasn't printing to stdout (and I could repro that
bug even on versions before I added the newline). It was only showing
up on other streams in the shell (error stream probably), not getting
sent into pipes.
I changed it to fmt.Println.
As for the ansi-stripping that was in `filter`, LMK if that's what you
prefer and I'll add it to `choose` too. I just wanted them to match.
* Add newline printing to --select-if-one
This matches how choose works normally when there are more than
one option.
* Add newline printing to filter --select-if-one
To match how it works without --select-if-one.
* Add `--select-if-one` flag to `choose`/`filter`.
* Remove accidental commit of other changes.
* fix: use o.Options
---------
Co-authored-by: Maas Lalani <maas@lalani.dev>
Instead of needing to run the commands manually in main.go, we can implement the `Run(...) error` method to satisfy the command interface so that `kong` can Run our commands for us.
This commit uses the embedded style struct for styling in all components. The most notable example is `gum write` where there are many styles that are used and composed for each component of the command.
gum choose allows the user to be prompted for a choice from a list of choices.
For example, let's ask the user to pick a card from a deck.
gum choose --height 15 {Ace,King,Queen,Jack,Ten,Nine,Eight,Seven,Six,Five,Four,Three,Two}" of "{Spades,Hearts,Clubs,Diamonds}