-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add interact_opt Confirm example * Execute private _interact_on fn Makes `Confirm::interact_on` call private fn `Confirm::_interact_on`, which will allow for optionally allowing the user to quit. * Read key instead of char Allows handling of escape key * Change return type to Result<Option<bool>> Changes the return type of `Confirm::_interact_on`, and handles the rendered answer when it is `None`. * Handle quitting Confirm in private fn * Add optional interactions for Confirm Allows the user to answer neither "yes" nor "no" * Make exit clear confirm when waiting for newline * Display cancel instead of n/a * Set example confirm default to yes Sets the default value to "yes" for the optional confirm that waits for a newline, to simplify viewing behavior of a "quit" input when waiting for newline. Per discussion in #101 * Only set None value to default if quit forbidden Prevents the value of confirm prompt from being converted to the default value when no value selected *only if* returning a None value is allowed. * Show no selected value when it is None Removes the "cancel" output from an optional confirm. Per discussion in #101
- Loading branch information
1 parent
0250090
commit 64f5f9c
Showing
3 changed files
with
108 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters