Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement yes-no prompt #86

Open
hampuslidin opened this issue Dec 5, 2022 · 0 comments
Open

Implement yes-no prompt #86

hampuslidin opened this issue Dec 5, 2022 · 0 comments
Labels
A-logging Area - Logging C-enhancement Category - New feature or request C-good-first-issue Category - Good for newcomers D-easy Difficulty - Easy P-low Priority - Low

Comments

@hampuslidin
Copy link
Contributor

hampuslidin commented Dec 5, 2022

Implement a shorthand [Y/n] or [y/N] input prompt for simple yes or no questions. It should use the Text backend and parse into a bool.

Proposal

3 builder methods to be added:

fn yes_or_no(self) -> PromptBuilder<YesNo> { .. } // should render "[y/n]" suffix
fn yes_else_no(self) -> PromptBuilder<YesNo> { .. } // should render "[Y/n]" suffix
fn no_else_yes(self) -> PromptBuilder<YesNo> { .. } // should render "[y/N]" suffix
@hampuslidin hampuslidin added C-enhancement Category - New feature or request C-good-first-issue Category - Good for newcomers D-easy Difficulty - Easy P-low Priority - Low A-logging Area - Logging labels Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-logging Area - Logging C-enhancement Category - New feature or request C-good-first-issue Category - Good for newcomers D-easy Difficulty - Easy P-low Priority - Low
Projects
None yet
Development

No branches or pull requests

1 participant