trasher 2.0.4

A small command-line utility to replace 'rm' and 'del' by a trash system
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::sync::atomic::AtomicBool;

pub static PRINT_DEBUG_MESSAGES: AtomicBool = AtomicBool::new(false);

#[macro_export]
macro_rules! fail {
    ($message: expr$(,$params: expr)*) => {{
        eprintln!(concat!("\x1B[91m", "ERROR: ", $message, "\x1B[0m"), $($params,)*);
        std::process::exit(1);
    }}
}

#[macro_export]
macro_rules! debug {
    ($message: expr$(,$params: expr)*) => { if $crate::logging::PRINT_DEBUG_MESSAGES.load(::std::sync::atomic::Ordering::SeqCst) { println!(concat!("[DEBUG] ", $message), $($params,)*); } }
}