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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// use std::error::Error;
// use minimo::{banner::Banner, choice, console::ask::*, selection, showln };
// use minimo::*;
// fn main() -> Result<(), Box<dyn Error>> {
// Banner::new("minimo").show(cyan_bold);
// let name = text!("What is your name?", "Anonymous".to_string());
// let age = number!("What is your age?", 20);
// let gender = confirm!("Are you a man?", true);
// let options = vec![
// choice!("option 1", "description for option 1", || {
// set!(name, "value".to_string());
// set!(age, 42);
// set!(gender, true);
// println!("Action for Option 1");
// Ok("Option 1".into())
// }),
// choice!("option 2", "description for option 2", || {
// set!(name_key, "value".to_string());
// set!(age_key, 42);
// set!(gender_key, true);
// println!("Action for Option 2");
// Ok("Option 2".into())
// }),
// choice!("option 3", "description for option 3", || {
// set!(name_key, "value".to_string());
// set!(age_key, 42);
// set!(gender_key, true);
// println!("Action for Option 3");
// Ok("Option 3".into())
// }),
// ];
// let selected : Choice<String> = selection!("Choose an option:", &options).unwrap();
// let context = selected.run().unwrap();
// if let Some(result) = maybe!(name_key) {
// println!("String result: {}", result);
// }
// if let Some(result) = maybe!(age_key) {
// println!("i32 result: {}", result);
// }
// println!("Vector result: {:?}", get!(vector_key));
// Ok(())
// }
use ;