mikaelmello / inquire

A Rust library for building interactive prompts
https://docs.rs/inquire
MIT License
1.71k stars 72 forks source link

Global/default add value #254

Open stacksjb opened 1 month ago

stacksjb commented 1 month ago

Is your feature request related to a problem? Please describe. I'm working on a stacked menu app using inquire, which works very well. However, in order to allow forward/backward (to sub menu/previous menu), I have to explicitly add a back option to each menu.

Describe the solution you'd like I'd like to somehow be able to add a back or default menu option(s) to every menu, by default and/or globally

Instead, I have to do something like: menu_options.push("q. Exit".to_string()); On every single menu.

Describe alternatives you've considered Manually adding to each stage is the default workaround

stacksjb commented 1 month ago

Looking more into this, can I use the skippable/escape key to perform a default action?

https://docs.rs/inquire/latest/inquire/struct.Confirm.html