1use std::sync::Arc;
2use minimo::banner::Banner;
3use minimo::*;
4use minimo::ask::*;
5
6fn main() {
7
8
9 Banner::new("minimo").show(yellow_bold);
10
11 showln!(yellow_bold, "minimo",gray_dim, "VERSION 0.1.0", white,"A minimalistic terminal printing library for Rust");
13
14 showln!(gray, "You can use ", magenta, "show!", gray, " or ", yellow, "showln!", gray, " macros");
16 showln!(gray, "to print text segments in different colors.\n(Make sure each segment starts with a color)");
17
18 "You can also use ".show(white_dim);
20 "show! ".show(pink);
21 "and ".show(purple_bold);
22 "showln! ".show(cyan);
23 " macros to print random text segments with formatting.".showln(white_dim);
24
25 divider_vibrant();
27
28
29
30 divider_vibrant();
32
33 "Bold and colorful text: ".show(red);
35 "Bold".show(bold);
36 ", ".show(blink);
37 "Italic".show(italic);
38 ", and ".show(red);
39 "Underlined".showln(underline);
40
41 "Vibrant text example: ".vibrant().print();
43
44
45 divider();
47 "Divider above".style(red).print();
48 reset_line();
49 "Reset line used".show(red);
50
51
52
53 let name = text("What is your name?").unwrap();
74 showln!(green, "Hello, ", yellow, name, green, "!");
75
76 let choices = vec![
78 choice!("First choice", "This is the first choice", || {
79 println!("First choice selected");
80 Ok("First choice selected".into())
81 }),
82 choice!("Second choice", "This is the second choice", || {
83 println!("Second choice selected");
84 Ok("Second choice selected".into())
85 }),
86 choice!("Third choice", "This is the third choice", || {
87 println!("Third choice selected");
88 Ok("Third choice selected".into())
89 }),
90 ];
91
92 let selected : Choice<String> = selection!("Select an option", &choices).unwrap();
94 showln!(gray, "You selected: ", yellow, selected.name);
95 selected.run().unwrap();
96}