pub struct Confirm<'a> { /* private fields */ }
Expand description
Renders a confirm prompt.
§Example
use dialoguer::Confirm;
fn main() {
let confirmation = Confirm::new()
.with_prompt("Do you want to continue?")
.interact()
.unwrap();
if confirmation {
println!("Looks like you want to continue");
} else {
println!("nevermind then :(");
}
}
Implementations§
Source§impl Confirm<'_>
impl Confirm<'_>
Sourcepub fn with_prompt<S: Into<String>>(self, prompt: S) -> Self
pub fn with_prompt<S: Into<String>>(self, prompt: S) -> Self
Sets the confirm prompt.
Examples found in repository?
4fn main() {
5 let items = &[
6 "Ice Cream",
7 "Vanilla Cupcake",
8 "Chocolate Muffin",
9 "A Pile of sweet, sweet mustard",
10 ];
11 let term = Term::buffered_stderr();
12 let theme = ColorfulTheme::default();
13
14 println!("All the following controls are run in a buffered terminal");
15 Confirm::with_theme(&theme)
16 .with_prompt("Do you want to continue?")
17 .interact_on(&term)
18 .unwrap();
19
20 let _: String = Input::with_theme(&theme)
21 .with_prompt("Your name")
22 .interact_on(&term)
23 .unwrap();
24
25 Select::with_theme(&theme)
26 .with_prompt("Pick an item")
27 .items(items)
28 .interact_on(&term)
29 .unwrap();
30
31 MultiSelect::with_theme(&theme)
32 .with_prompt("Pick some items")
33 .items(items)
34 .interact_on(&term)
35 .unwrap();
36
37 Sort::with_theme(&theme)
38 .with_prompt("Order these items")
39 .items(items)
40 .interact_on(&term)
41 .unwrap();
42}
More examples
17fn init_config() -> Result<Option<Config>, Box<dyn Error>> {
18 let theme = ColorfulTheme {
19 values_style: Style::new().yellow().dim(),
20 ..ColorfulTheme::default()
21 };
22 println!("Welcome to the setup wizard");
23
24 if !Confirm::with_theme(&theme)
25 .with_prompt("Do you want to continue?")
26 .interact()?
27 {
28 return Ok(None);
29 }
30
31 let interface = Input::with_theme(&theme)
32 .with_prompt("Interface")
33 .default("127.0.0.1".parse().unwrap())
34 .interact()?;
35
36 let hostname = Input::with_theme(&theme)
37 .with_prompt("Hostname")
38 .interact()?;
39
40 let tls = Select::with_theme(&theme)
41 .with_prompt("Configure TLS")
42 .default(0)
43 .item("automatic with ACME")
44 .item("manual")
45 .item("no")
46 .interact()?;
47
48 let (private_key, cert, use_acme) = match tls {
49 0 => (Some("acme.pkey".into()), Some("acme.cert".into()), true),
50 1 => (
51 Some(
52 Input::with_theme(&theme)
53 .with_prompt(" Path to private key")
54 .interact()?,
55 ),
56 Some(
57 Input::with_theme(&theme)
58 .with_prompt(" Path to certificate")
59 .interact()?,
60 ),
61 false,
62 ),
63 _ => (None, None, false),
64 };
65
66 Ok(Some(Config {
67 hostname,
68 interface,
69 private_key,
70 cert,
71 use_acme,
72 }))
73}
3fn main() {
4 if Confirm::with_theme(&ColorfulTheme::default())
5 .with_prompt("Do you want to continue?")
6 .interact()
7 .unwrap()
8 {
9 println!("Looks like you want to continue");
10 } else {
11 println!("nevermind then :(");
12 }
13
14 if Confirm::with_theme(&ColorfulTheme::default())
15 .with_prompt("Do you really want to continue?")
16 .default(true)
17 .interact()
18 .unwrap()
19 {
20 println!("Looks like you want to continue");
21 } else {
22 println!("nevermind then :(");
23 }
24
25 if Confirm::with_theme(&ColorfulTheme::default())
26 .with_prompt("Do you really really want to continue?")
27 .default(true)
28 .show_default(false)
29 .wait_for_newline(true)
30 .interact()
31 .unwrap()
32 {
33 println!("Looks like you want to continue");
34 } else {
35 println!("nevermind then :(");
36 }
37
38 if Confirm::with_theme(&ColorfulTheme::default())
39 .with_prompt("Do you really really really want to continue?")
40 .wait_for_newline(true)
41 .interact()
42 .unwrap()
43 {
44 println!("Looks like you want to continue");
45 } else {
46 println!("nevermind then :(");
47 }
48
49 match Confirm::with_theme(&ColorfulTheme::default())
50 .with_prompt("Do you really really really really want to continue?")
51 .interact_opt()
52 .unwrap()
53 {
54 Some(true) => println!("Looks like you want to continue"),
55 Some(false) => println!("nevermind then :("),
56 None => println!("Ok, we can start over later"),
57 }
58
59 match Confirm::with_theme(&ColorfulTheme::default())
60 .with_prompt("Do you really really really really really want to continue?")
61 .default(true)
62 .wait_for_newline(true)
63 .interact_opt()
64 .unwrap()
65 {
66 Some(true) => println!("Looks like you want to continue"),
67 Some(false) => println!("nevermind then :("),
68 None => println!("Ok, we can start over later"),
69 }
70}
Sourcepub fn report(self, val: bool) -> Self
pub fn report(self, val: bool) -> Self
Indicates whether or not to report the chosen selection after interaction.
The default is to report the chosen selection.
Sourcepub fn wait_for_newline(self, wait: bool) -> Self
pub fn wait_for_newline(self, wait: bool) -> Self
Sets when to react to user input.
When false
(default), we check on each user keystroke immediately as
it is typed. Valid inputs can be one of ‘y’, ‘n’, or a newline to accept
the default.
When true
, the user must type their choice and hit the Enter key before
proceeding. Valid inputs can be “yes”, “no”, “y”, “n”, or an empty string
to accept the default.
Examples found in repository?
3fn main() {
4 if Confirm::with_theme(&ColorfulTheme::default())
5 .with_prompt("Do you want to continue?")
6 .interact()
7 .unwrap()
8 {
9 println!("Looks like you want to continue");
10 } else {
11 println!("nevermind then :(");
12 }
13
14 if Confirm::with_theme(&ColorfulTheme::default())
15 .with_prompt("Do you really want to continue?")
16 .default(true)
17 .interact()
18 .unwrap()
19 {
20 println!("Looks like you want to continue");
21 } else {
22 println!("nevermind then :(");
23 }
24
25 if Confirm::with_theme(&ColorfulTheme::default())
26 .with_prompt("Do you really really want to continue?")
27 .default(true)
28 .show_default(false)
29 .wait_for_newline(true)
30 .interact()
31 .unwrap()
32 {
33 println!("Looks like you want to continue");
34 } else {
35 println!("nevermind then :(");
36 }
37
38 if Confirm::with_theme(&ColorfulTheme::default())
39 .with_prompt("Do you really really really want to continue?")
40 .wait_for_newline(true)
41 .interact()
42 .unwrap()
43 {
44 println!("Looks like you want to continue");
45 } else {
46 println!("nevermind then :(");
47 }
48
49 match Confirm::with_theme(&ColorfulTheme::default())
50 .with_prompt("Do you really really really really want to continue?")
51 .interact_opt()
52 .unwrap()
53 {
54 Some(true) => println!("Looks like you want to continue"),
55 Some(false) => println!("nevermind then :("),
56 None => println!("Ok, we can start over later"),
57 }
58
59 match Confirm::with_theme(&ColorfulTheme::default())
60 .with_prompt("Do you really really really really really want to continue?")
61 .default(true)
62 .wait_for_newline(true)
63 .interact_opt()
64 .unwrap()
65 {
66 Some(true) => println!("Looks like you want to continue"),
67 Some(false) => println!("nevermind then :("),
68 None => println!("Ok, we can start over later"),
69 }
70}
Sourcepub fn default(self, val: bool) -> Self
pub fn default(self, val: bool) -> Self
Sets a default.
Out of the box the prompt does not have a default and will continue to display until the user inputs something and hits enter. If a default is set the user can instead accept the default with enter.
Examples found in repository?
3fn main() {
4 if Confirm::with_theme(&ColorfulTheme::default())
5 .with_prompt("Do you want to continue?")
6 .interact()
7 .unwrap()
8 {
9 println!("Looks like you want to continue");
10 } else {
11 println!("nevermind then :(");
12 }
13
14 if Confirm::with_theme(&ColorfulTheme::default())
15 .with_prompt("Do you really want to continue?")
16 .default(true)
17 .interact()
18 .unwrap()
19 {
20 println!("Looks like you want to continue");
21 } else {
22 println!("nevermind then :(");
23 }
24
25 if Confirm::with_theme(&ColorfulTheme::default())
26 .with_prompt("Do you really really want to continue?")
27 .default(true)
28 .show_default(false)
29 .wait_for_newline(true)
30 .interact()
31 .unwrap()
32 {
33 println!("Looks like you want to continue");
34 } else {
35 println!("nevermind then :(");
36 }
37
38 if Confirm::with_theme(&ColorfulTheme::default())
39 .with_prompt("Do you really really really want to continue?")
40 .wait_for_newline(true)
41 .interact()
42 .unwrap()
43 {
44 println!("Looks like you want to continue");
45 } else {
46 println!("nevermind then :(");
47 }
48
49 match Confirm::with_theme(&ColorfulTheme::default())
50 .with_prompt("Do you really really really really want to continue?")
51 .interact_opt()
52 .unwrap()
53 {
54 Some(true) => println!("Looks like you want to continue"),
55 Some(false) => println!("nevermind then :("),
56 None => println!("Ok, we can start over later"),
57 }
58
59 match Confirm::with_theme(&ColorfulTheme::default())
60 .with_prompt("Do you really really really really really want to continue?")
61 .default(true)
62 .wait_for_newline(true)
63 .interact_opt()
64 .unwrap()
65 {
66 Some(true) => println!("Looks like you want to continue"),
67 Some(false) => println!("nevermind then :("),
68 None => println!("Ok, we can start over later"),
69 }
70}
Sourcepub fn show_default(self, val: bool) -> Self
pub fn show_default(self, val: bool) -> Self
Disables or enables the default value display.
The default is to append the default value to the prompt to tell the user.
Examples found in repository?
3fn main() {
4 if Confirm::with_theme(&ColorfulTheme::default())
5 .with_prompt("Do you want to continue?")
6 .interact()
7 .unwrap()
8 {
9 println!("Looks like you want to continue");
10 } else {
11 println!("nevermind then :(");
12 }
13
14 if Confirm::with_theme(&ColorfulTheme::default())
15 .with_prompt("Do you really want to continue?")
16 .default(true)
17 .interact()
18 .unwrap()
19 {
20 println!("Looks like you want to continue");
21 } else {
22 println!("nevermind then :(");
23 }
24
25 if Confirm::with_theme(&ColorfulTheme::default())
26 .with_prompt("Do you really really want to continue?")
27 .default(true)
28 .show_default(false)
29 .wait_for_newline(true)
30 .interact()
31 .unwrap()
32 {
33 println!("Looks like you want to continue");
34 } else {
35 println!("nevermind then :(");
36 }
37
38 if Confirm::with_theme(&ColorfulTheme::default())
39 .with_prompt("Do you really really really want to continue?")
40 .wait_for_newline(true)
41 .interact()
42 .unwrap()
43 {
44 println!("Looks like you want to continue");
45 } else {
46 println!("nevermind then :(");
47 }
48
49 match Confirm::with_theme(&ColorfulTheme::default())
50 .with_prompt("Do you really really really really want to continue?")
51 .interact_opt()
52 .unwrap()
53 {
54 Some(true) => println!("Looks like you want to continue"),
55 Some(false) => println!("nevermind then :("),
56 None => println!("Ok, we can start over later"),
57 }
58
59 match Confirm::with_theme(&ColorfulTheme::default())
60 .with_prompt("Do you really really really really really want to continue?")
61 .default(true)
62 .wait_for_newline(true)
63 .interact_opt()
64 .unwrap()
65 {
66 Some(true) => println!("Looks like you want to continue"),
67 Some(false) => println!("nevermind then :("),
68 None => println!("Ok, we can start over later"),
69 }
70}
Sourcepub fn interact(self) -> Result<bool>
pub fn interact(self) -> Result<bool>
Enables user interaction and returns the result.
The dialog is rendered on stderr.
Result contains bool
if user answered “yes” or “no” or default
(configured in default
if pushes enter.
This unlike interact_opt
does not allow to quit with ‘Esc’ or ‘q’.
Examples found in repository?
17fn init_config() -> Result<Option<Config>, Box<dyn Error>> {
18 let theme = ColorfulTheme {
19 values_style: Style::new().yellow().dim(),
20 ..ColorfulTheme::default()
21 };
22 println!("Welcome to the setup wizard");
23
24 if !Confirm::with_theme(&theme)
25 .with_prompt("Do you want to continue?")
26 .interact()?
27 {
28 return Ok(None);
29 }
30
31 let interface = Input::with_theme(&theme)
32 .with_prompt("Interface")
33 .default("127.0.0.1".parse().unwrap())
34 .interact()?;
35
36 let hostname = Input::with_theme(&theme)
37 .with_prompt("Hostname")
38 .interact()?;
39
40 let tls = Select::with_theme(&theme)
41 .with_prompt("Configure TLS")
42 .default(0)
43 .item("automatic with ACME")
44 .item("manual")
45 .item("no")
46 .interact()?;
47
48 let (private_key, cert, use_acme) = match tls {
49 0 => (Some("acme.pkey".into()), Some("acme.cert".into()), true),
50 1 => (
51 Some(
52 Input::with_theme(&theme)
53 .with_prompt(" Path to private key")
54 .interact()?,
55 ),
56 Some(
57 Input::with_theme(&theme)
58 .with_prompt(" Path to certificate")
59 .interact()?,
60 ),
61 false,
62 ),
63 _ => (None, None, false),
64 };
65
66 Ok(Some(Config {
67 hostname,
68 interface,
69 private_key,
70 cert,
71 use_acme,
72 }))
73}
More examples
3fn main() {
4 if Confirm::with_theme(&ColorfulTheme::default())
5 .with_prompt("Do you want to continue?")
6 .interact()
7 .unwrap()
8 {
9 println!("Looks like you want to continue");
10 } else {
11 println!("nevermind then :(");
12 }
13
14 if Confirm::with_theme(&ColorfulTheme::default())
15 .with_prompt("Do you really want to continue?")
16 .default(true)
17 .interact()
18 .unwrap()
19 {
20 println!("Looks like you want to continue");
21 } else {
22 println!("nevermind then :(");
23 }
24
25 if Confirm::with_theme(&ColorfulTheme::default())
26 .with_prompt("Do you really really want to continue?")
27 .default(true)
28 .show_default(false)
29 .wait_for_newline(true)
30 .interact()
31 .unwrap()
32 {
33 println!("Looks like you want to continue");
34 } else {
35 println!("nevermind then :(");
36 }
37
38 if Confirm::with_theme(&ColorfulTheme::default())
39 .with_prompt("Do you really really really want to continue?")
40 .wait_for_newline(true)
41 .interact()
42 .unwrap()
43 {
44 println!("Looks like you want to continue");
45 } else {
46 println!("nevermind then :(");
47 }
48
49 match Confirm::with_theme(&ColorfulTheme::default())
50 .with_prompt("Do you really really really really want to continue?")
51 .interact_opt()
52 .unwrap()
53 {
54 Some(true) => println!("Looks like you want to continue"),
55 Some(false) => println!("nevermind then :("),
56 None => println!("Ok, we can start over later"),
57 }
58
59 match Confirm::with_theme(&ColorfulTheme::default())
60 .with_prompt("Do you really really really really really want to continue?")
61 .default(true)
62 .wait_for_newline(true)
63 .interact_opt()
64 .unwrap()
65 {
66 Some(true) => println!("Looks like you want to continue"),
67 Some(false) => println!("nevermind then :("),
68 None => println!("Ok, we can start over later"),
69 }
70}
Sourcepub fn interact_opt(self) -> Result<Option<bool>>
pub fn interact_opt(self) -> Result<Option<bool>>
Enables user interaction and returns the result.
The dialog is rendered on stderr.
Result contains Some(bool)
if user answered “yes” or “no” or Some(default)
(configured in default
) if pushes enter,
or None
if user cancelled with ‘Esc’ or ‘q’.
§Example
use dialoguer::Confirm;
fn main() {
let confirmation = Confirm::new()
.interact_opt()
.unwrap();
match confirmation {
Some(answer) => println!("User answered {}", if answer { "yes" } else { "no " }),
None => println!("User did not answer")
}
}
Examples found in repository?
3fn main() {
4 if Confirm::with_theme(&ColorfulTheme::default())
5 .with_prompt("Do you want to continue?")
6 .interact()
7 .unwrap()
8 {
9 println!("Looks like you want to continue");
10 } else {
11 println!("nevermind then :(");
12 }
13
14 if Confirm::with_theme(&ColorfulTheme::default())
15 .with_prompt("Do you really want to continue?")
16 .default(true)
17 .interact()
18 .unwrap()
19 {
20 println!("Looks like you want to continue");
21 } else {
22 println!("nevermind then :(");
23 }
24
25 if Confirm::with_theme(&ColorfulTheme::default())
26 .with_prompt("Do you really really want to continue?")
27 .default(true)
28 .show_default(false)
29 .wait_for_newline(true)
30 .interact()
31 .unwrap()
32 {
33 println!("Looks like you want to continue");
34 } else {
35 println!("nevermind then :(");
36 }
37
38 if Confirm::with_theme(&ColorfulTheme::default())
39 .with_prompt("Do you really really really want to continue?")
40 .wait_for_newline(true)
41 .interact()
42 .unwrap()
43 {
44 println!("Looks like you want to continue");
45 } else {
46 println!("nevermind then :(");
47 }
48
49 match Confirm::with_theme(&ColorfulTheme::default())
50 .with_prompt("Do you really really really really want to continue?")
51 .interact_opt()
52 .unwrap()
53 {
54 Some(true) => println!("Looks like you want to continue"),
55 Some(false) => println!("nevermind then :("),
56 None => println!("Ok, we can start over later"),
57 }
58
59 match Confirm::with_theme(&ColorfulTheme::default())
60 .with_prompt("Do you really really really really really want to continue?")
61 .default(true)
62 .wait_for_newline(true)
63 .interact_opt()
64 .unwrap()
65 {
66 Some(true) => println!("Looks like you want to continue"),
67 Some(false) => println!("nevermind then :("),
68 None => println!("Ok, we can start over later"),
69 }
70}
Sourcepub fn interact_on(self, term: &Term) -> Result<bool>
pub fn interact_on(self, term: &Term) -> Result<bool>
Like interact
but allows a specific terminal to be set.
Examples found in repository?
4fn main() {
5 let items = &[
6 "Ice Cream",
7 "Vanilla Cupcake",
8 "Chocolate Muffin",
9 "A Pile of sweet, sweet mustard",
10 ];
11 let term = Term::buffered_stderr();
12 let theme = ColorfulTheme::default();
13
14 println!("All the following controls are run in a buffered terminal");
15 Confirm::with_theme(&theme)
16 .with_prompt("Do you want to continue?")
17 .interact_on(&term)
18 .unwrap();
19
20 let _: String = Input::with_theme(&theme)
21 .with_prompt("Your name")
22 .interact_on(&term)
23 .unwrap();
24
25 Select::with_theme(&theme)
26 .with_prompt("Pick an item")
27 .items(items)
28 .interact_on(&term)
29 .unwrap();
30
31 MultiSelect::with_theme(&theme)
32 .with_prompt("Pick some items")
33 .items(items)
34 .interact_on(&term)
35 .unwrap();
36
37 Sort::with_theme(&theme)
38 .with_prompt("Order these items")
39 .items(items)
40 .interact_on(&term)
41 .unwrap();
42}
Sourcepub fn interact_on_opt(self, term: &Term) -> Result<Option<bool>>
pub fn interact_on_opt(self, term: &Term) -> Result<Option<bool>>
Like interact_opt
but allows a specific terminal to be set.
Source§impl<'a> Confirm<'a>
impl<'a> Confirm<'a>
Sourcepub fn with_theme(theme: &'a dyn Theme) -> Self
pub fn with_theme(theme: &'a dyn Theme) -> Self
Creates a confirm prompt with a specific theme.
§Example
use dialoguer::{theme::ColorfulTheme, Confirm};
fn main() {
let confirmation = Confirm::with_theme(&ColorfulTheme::default())
.interact()
.unwrap();
}
Examples found in repository?
4fn main() {
5 let items = &[
6 "Ice Cream",
7 "Vanilla Cupcake",
8 "Chocolate Muffin",
9 "A Pile of sweet, sweet mustard",
10 ];
11 let term = Term::buffered_stderr();
12 let theme = ColorfulTheme::default();
13
14 println!("All the following controls are run in a buffered terminal");
15 Confirm::with_theme(&theme)
16 .with_prompt("Do you want to continue?")
17 .interact_on(&term)
18 .unwrap();
19
20 let _: String = Input::with_theme(&theme)
21 .with_prompt("Your name")
22 .interact_on(&term)
23 .unwrap();
24
25 Select::with_theme(&theme)
26 .with_prompt("Pick an item")
27 .items(items)
28 .interact_on(&term)
29 .unwrap();
30
31 MultiSelect::with_theme(&theme)
32 .with_prompt("Pick some items")
33 .items(items)
34 .interact_on(&term)
35 .unwrap();
36
37 Sort::with_theme(&theme)
38 .with_prompt("Order these items")
39 .items(items)
40 .interact_on(&term)
41 .unwrap();
42}
More examples
17fn init_config() -> Result<Option<Config>, Box<dyn Error>> {
18 let theme = ColorfulTheme {
19 values_style: Style::new().yellow().dim(),
20 ..ColorfulTheme::default()
21 };
22 println!("Welcome to the setup wizard");
23
24 if !Confirm::with_theme(&theme)
25 .with_prompt("Do you want to continue?")
26 .interact()?
27 {
28 return Ok(None);
29 }
30
31 let interface = Input::with_theme(&theme)
32 .with_prompt("Interface")
33 .default("127.0.0.1".parse().unwrap())
34 .interact()?;
35
36 let hostname = Input::with_theme(&theme)
37 .with_prompt("Hostname")
38 .interact()?;
39
40 let tls = Select::with_theme(&theme)
41 .with_prompt("Configure TLS")
42 .default(0)
43 .item("automatic with ACME")
44 .item("manual")
45 .item("no")
46 .interact()?;
47
48 let (private_key, cert, use_acme) = match tls {
49 0 => (Some("acme.pkey".into()), Some("acme.cert".into()), true),
50 1 => (
51 Some(
52 Input::with_theme(&theme)
53 .with_prompt(" Path to private key")
54 .interact()?,
55 ),
56 Some(
57 Input::with_theme(&theme)
58 .with_prompt(" Path to certificate")
59 .interact()?,
60 ),
61 false,
62 ),
63 _ => (None, None, false),
64 };
65
66 Ok(Some(Config {
67 hostname,
68 interface,
69 private_key,
70 cert,
71 use_acme,
72 }))
73}
3fn main() {
4 if Confirm::with_theme(&ColorfulTheme::default())
5 .with_prompt("Do you want to continue?")
6 .interact()
7 .unwrap()
8 {
9 println!("Looks like you want to continue");
10 } else {
11 println!("nevermind then :(");
12 }
13
14 if Confirm::with_theme(&ColorfulTheme::default())
15 .with_prompt("Do you really want to continue?")
16 .default(true)
17 .interact()
18 .unwrap()
19 {
20 println!("Looks like you want to continue");
21 } else {
22 println!("nevermind then :(");
23 }
24
25 if Confirm::with_theme(&ColorfulTheme::default())
26 .with_prompt("Do you really really want to continue?")
27 .default(true)
28 .show_default(false)
29 .wait_for_newline(true)
30 .interact()
31 .unwrap()
32 {
33 println!("Looks like you want to continue");
34 } else {
35 println!("nevermind then :(");
36 }
37
38 if Confirm::with_theme(&ColorfulTheme::default())
39 .with_prompt("Do you really really really want to continue?")
40 .wait_for_newline(true)
41 .interact()
42 .unwrap()
43 {
44 println!("Looks like you want to continue");
45 } else {
46 println!("nevermind then :(");
47 }
48
49 match Confirm::with_theme(&ColorfulTheme::default())
50 .with_prompt("Do you really really really really want to continue?")
51 .interact_opt()
52 .unwrap()
53 {
54 Some(true) => println!("Looks like you want to continue"),
55 Some(false) => println!("nevermind then :("),
56 None => println!("Ok, we can start over later"),
57 }
58
59 match Confirm::with_theme(&ColorfulTheme::default())
60 .with_prompt("Do you really really really really really want to continue?")
61 .default(true)
62 .wait_for_newline(true)
63 .interact_opt()
64 .unwrap()
65 {
66 Some(true) => println!("Looks like you want to continue"),
67 Some(false) => println!("nevermind then :("),
68 None => println!("Ok, we can start over later"),
69 }
70}