2018-07-26 15:17:27 +00:00
|
|
|
use colored::*;
|
|
|
|
use std::process;
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! info {
|
|
|
|
($($arg:tt)*) => {
|
|
|
|
println!("├ {:7} — {}", "Info".green(), format_args!($($arg)*));
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! warning {
|
|
|
|
($($arg:tt)*) => {
|
|
|
|
println!("├ {:7} — {}", "Warning".yellow(), format_args!($($arg)*));
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! error {
|
|
|
|
($($arg:tt)*) => {
|
2018-07-27 21:43:24 +00:00
|
|
|
{
|
|
|
|
eprintln!("└ {:7} — {}", "Error".on_red().white(), format_args!($($arg)*));
|
|
|
|
println!("");
|
|
|
|
process::exit(0);
|
|
|
|
}
|
2018-07-26 15:17:27 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn welcome(string: &str) {
|
2018-07-27 21:43:24 +00:00
|
|
|
println!("┌{}┐", "─".repeat(string.len() + 20));
|
|
|
|
println!("│{text:^-width$}│", text = string, width = string.len() + 20);
|
|
|
|
println!("├{}┘", "─".repeat(string.len() + 20));
|
2018-07-26 15:17:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn goodbye() {
|
|
|
|
println!("└ {:7}", "Goodbye!".green());
|
|
|
|
process::exit(0);
|
|
|
|
}
|