use super::theme::ColoredTheme;
use dialoguer::Confirmation;
use std::io::Result;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
pub struct Confirm {
#[structopt(short, long)]
message: String,
#[structopt(short, long)]
default: bool,
}
impl Confirm {
pub fn run(&self) -> Result<()> {
let value = Confirmation::with_theme(&ColoredTheme::default())
.with_text(&self.message)
.default(self.default)
.interact()?;
if value {
println!("true");
} else {
println!("false");
}
Ok(())
}
}