forked from Lutetium-Vanadium/requestty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect.rs
25 lines (23 loc) · 771 Bytes
/
select.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use requestty::{DefaultSeparator, Question};
fn main() {
let questions = vec![
Question::select("theme")
.message("What do you want to do?")
.choices(vec![
"Order a pizza".into(),
"Make a reservation".into(),
DefaultSeparator,
"Ask for opening hours".into(),
"Contact support".into(),
"Talk to the receptionist".into(),
])
.build(),
Question::select("size")
.message("What size do you need?")
.choices(vec![
"Jumbo", "Large", "Standard", "Medium", "Small", "Micro",
])
.build(),
];
println!("{:#?}", requestty::prompt(questions));
}