Open sluedecke opened 1 year ago
Why can't confirm be used?
I tried, but it appeared to me that all ways to use Confirm present the user with some kind of choice. There is always the y/n
rendered and I am looking for an alert which can only be acknowleged.
This can be done with Confirm and setting a default, but having the 'y/n' suggests that there is a choice if there actually is none.
Sure. But I wonder if that would introduce a lot of "if-clauses" into the code making it more complex than needed. Right now I think a new prompt has these advantages:
report
, default
, show_default
and wait_for_newline
for an alert?interact_on
, theme/mod.rs::format_confirm_prompt
and theme/colorful.rs::format_confirm_prompt
more complex.Probably it is just a mattter of coding style, what do you think?
In case of an unexpected events, I would love to display a warning to the user, which simply needs to be "confirmed" for the programm to move on.
The workaround I use is a selection with "OK" as single option, but this is a bit hacky.
I kindly request to add alert as a new interaction option to dialoguer. One can use the pull request, but I probably messed the return types up ...
obsoletes https://github.com/console-rs/dialoguer/issues/287