macro_rules! selection {
($message:expr,$choices:expr) => { ... };
($choices:expr) => { ... };
}Expand description
ยงselection! macro
a macro display a menu and return the selected choice example:
let choices = vec![
choice!("say hello","prints hello",|args| println!("hello"),|args| args.len() == 1),
choice!("say hi","prints hi",|args| println!("hi"),|args| args.len() == 1),
choice!("say bye","prints bye",|args| println!("bye"),|args| args.len() == 1),
];
let selected = selection!("what would you like to say?",choices);
//or withouth the description
let selected = selection!(choices);