charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.94k stars 339 forks source link

Confirm does not allow to default to the negative action #599

Closed depau closed 4 months ago

depau commented 4 months ago

Describe the bug

gum confirm does not have a way to default to "no". The --default option seems to be intended to allow that, but it does nothing since it defaults to true and providing it sets it to true.

To Reproduce Steps to reproduce the behavior:

  1. Run gum confirm --help
  2. Be surprised when the only way to swap the options seems to be renaming yes to no and no to yes and negating the result.

Expected behavior I'd expect there to be a way to start with "No" selected.

Desktop (please complete the following information):

depau commented 4 months ago

Actually, just after submitting the issue, I realized that running gum confirm --default=false does work. I previously only tried --default false, which just sets Default to true and uses false as the prompt.

I'd suggest improving the help message to clarify the usage.