mirror of
https://github.com/sharkdp/bat
synced 2024-11-28 06:40:26 +00:00
47bb4a9c0f
This macro is intended to be package-internal and is not to be considered part of the public lib API. Use it in three places to reduce code duplication. However, main reason for this refactoring is to allow us to fix #1063 without duplicating the code yet another time. The macro can also be used for the "Binary content from {} will not be printed to the terminal" message if that message starts to use eprintln! instead (if ever). To trigger/verify the changed code, the following commands can be used: cargo run -- --theme=ansi-light tests/examples/single-line.txt cargo run -- --theme=does-not-exist tests/examples/single-line.txt cargo run -- --style=grid,rule tests/examples/single-line.txt
7 lines
194 B
Rust
7 lines
194 B
Rust
#[macro_export]
|
|
macro_rules! bat_warning {
|
|
($($arg:tt)*) => ({
|
|
use ansi_term::Colour::Yellow;
|
|
eprintln!("{}: {}", Yellow.paint("[bat warning]"), format!($($arg)*));
|
|
})
|
|
}
|