mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
change/uucore ~ add execution_phrase!() macro for use with usage messages
This commit is contained in:
committed by
Michael Debertol
parent
f56fc5bf44
commit
318f366ace
@@ -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) => ({
|
||||
|
||||
Reference in New Issue
Block a user