1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

change/uucore ~ add execution_phrase!() macro for use with usage messages

This commit is contained in:
Roy Ivy III 2021-07-28 16:22:02 -05:00 committed by Michael Debertol
parent f56fc5bf44
commit 318f366ace

View file

@ -58,6 +58,23 @@ macro_rules! util_name(
//====
/// Derive the complete execution phrase for "usage".
#[macro_export]
macro_rules! execution_phrase(
() => ({
let exe = if (executable_name!() == util_name!()) {
executable!().to_string()
} else {
format!("{} {}", executable!(), util_name!())
.as_str()
.to_owned()
};
&exe.to_owned()
})
);
//====
#[macro_export]
macro_rules! show(
($err:expr) => ({