summaryrefslogtreecommitdiffstats
path: root/src/macros.rs
blob: a41443cf3f01de8c9383f208ce129b6a5a190fb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[macro_export]
macro_rules! printerr {
    ($($arg:tt)*) => ({
        use std::io::{Write, stderr};
        use crossterm::{execute};
        use crossterm::style::{Print, SetForegroundColor, ResetColor, Color};
        execute!(
            stderr(),
            SetForegroundColor(Color::Red),
            Print("✖ ".to_string()),
            Print($($arg)*.to_string()),
            ResetColor
        ).ok();
    })
}