mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 19:45:29 +00:00
25 lines
492 B
Rust
25 lines
492 B
Rust
use crate::NO_COLOR_IS_SET;
|
|
|
|
#[macro_export]
|
|
macro_rules! info {
|
|
($writer:expr, $($arg:tt)*) => {
|
|
use crate::macros::_info_helper;
|
|
_info_helper();
|
|
println!($writer, $($arg)*);
|
|
};
|
|
($writer:expr) => {
|
|
_info_helper();
|
|
println!($writer);
|
|
};
|
|
}
|
|
|
|
pub fn _info_helper() {
|
|
use crate::utils::colors::{reset, yellow};
|
|
|
|
if *NO_COLOR_IS_SET {
|
|
print!("[INFO] ");
|
|
} else {
|
|
print!("{}[INFO]{} ", yellow(), reset());
|
|
}
|
|
}
|