menu

Macro menu 

Source
macro_rules! menu {
    ( $prompt:expr, [$( $menu_item:expr ),*]) => { ... };
    ( $prompt:expr, $configuration:expr, [$( $menu_item:expr ),*]) => { ... };
}
Expand description

Creates a Menu in one line

For the best experience, pair it with the menu_item! macro for simple menu declaration.

You can also configure the menu by passing a MenuOptions. If this is not provided, the defaults are used instead

ยงExample

let configuration = MenuOptions::new();
let menu = menu!(
      "Pick a number: ",
      configuration,
      [
          menu_item!("Item Number 1", true, 1),
          menu_item!("Item Number 2", true, 1),
      ]
)

let usr_choice = menu.serve()?;
println!("{}", usr_choice);