1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 23:17:46 +00:00

uucore: add disp_err macro

This commit is contained in:
Knight 2016-05-21 18:19:13 +08:00 committed by Roy Ivy III
parent 713770c9ae
commit b0588e482e

View file

@ -43,6 +43,15 @@ macro_rules! show_info(
})
);
#[macro_export]
macro_rules! disp_err(
($($args:tt)+) => ({
pipe_write!(&mut ::std::io::stderr(), "{}: ", executable!());
pipe_writeln!(&mut ::std::io::stderr(), $($args)+);
pipe_writeln!(&mut ::std::io::stderr(), "Try '{} --help' for more information.", executable!());
})
);
#[macro_export]
macro_rules! eprint(
($($args:tt)+) => (pipe_write!(&mut ::std::io::stderr(), $($args)+))