use std::io::{self, Write};
use term;
pub fn confirm(prompt: &str, same_line: bool, color: term::color::Color) -> bool {
if same_line {
print_color!(color, "{} ", prompt);
} else {
println_color!(color, "{} ", prompt);
}
io::stdout().flush().unwrap();
let mut input = String::new();
let mut t = term::stderr().unwrap();
t.fg(color).unwrap();
let mut ret_code: bool = false;
io::stdin().read_line(&mut input).ok();
match &*input.trim().to_lowercase() {
"y" | "yes" => {
ret_code = true;
},
_ => {},
}
t.reset().unwrap();
ret_code
}