Forgot to add this file in commit 3558a4869a
This file is necessary to completely resolve issue #4
This commit is contained in:
parent
3558a4869a
commit
82abb70314
35
src/messages.rs
Normal file
35
src/messages.rs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
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)*) => {
|
||||||
|
eprintln!("└ {:7} — {}", "Error".on_red().white(), format_args!($($arg)*));
|
||||||
|
process::exit(0);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn welcome(string: &str) {
|
||||||
|
println!("┌{}┐", "─".repeat(string.len() + 2));
|
||||||
|
println!("│{text:^-width$}│", text = string, width = string.len() + 2);
|
||||||
|
println!("├{}┘", "─".repeat(string.len() + 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn goodbye() {
|
||||||
|
println!("└ {:7}", "Goodbye!".green());
|
||||||
|
process::exit(0);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user