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

This commit is contained in:
Roy Ivy III
2021-08-14 13:58:45 +02:00
committed by Michael Debertol
parent f56fc5bf44
commit 318f366ace
+17
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) => ({