feat: add information!()
This commit is contained in:
@@ -12,6 +12,9 @@ use cmd::{ Command, CommandError };
|
||||
use cmd_default::CommandDefault;
|
||||
use cmd_new::CommandNew;
|
||||
|
||||
#[macro_export] macro_rules! information {
|
||||
($($arg:tt)+) => ( crate::print_in(&format!($($arg)+)); )
|
||||
}
|
||||
#[macro_export] macro_rules! success {
|
||||
($($arg:tt)+) => ( crate::print_ok(&format!($($arg)+)); )
|
||||
}
|
||||
@@ -19,6 +22,10 @@ use cmd_new::CommandNew;
|
||||
($($arg:tt)+) => ( crate::print_wa(&format!($($arg)+)); )
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn print_in (msg: &str) {
|
||||
println!("{b}[INFO]{e} {m}", b = "\x1B[1m", e = "\x1B[0m", m = msg);
|
||||
}
|
||||
#[inline]
|
||||
fn print_ok (msg: &str) {
|
||||
println!("{g}{b}[ OK ]{e} {g}{m}{e}", g = "\x1B[92m", b = "\x1B[1m", e = "\x1B[0m", m = msg);
|
||||
|
||||
Reference in New Issue
Block a user