1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

refactor/uucore ~ mark executable!() as deprecated

Make sure that utilities do not use it anymore.
It is only allowed as  an implementation detail of util_name!() and execution_phrase!()
This commit is contained in:
Michael Debertol 2021-08-14 14:19:05 +02:00
parent 813b477859
commit 3039083521

View file

@ -20,6 +20,7 @@ macro_rules! executable_os(
/// Get the executable path (as `String`). /// Get the executable path (as `String`).
#[macro_export] #[macro_export]
#[deprecated = "Use util_name!() or execution_phrase!() instead"]
macro_rules! executable( macro_rules! executable(
() => ({ () => ({
$crate::executable_os!().to_string_lossy().to_string() $crate::executable_os!().to_string_lossy().to_string()
@ -33,7 +34,10 @@ macro_rules! util_name(
if $crate::get_utility_is_second_arg() { if $crate::get_utility_is_second_arg() {
$crate::args_os().nth(1).unwrap().to_string_lossy().to_string() $crate::args_os().nth(1).unwrap().to_string_lossy().to_string()
} else { } else {
$crate::executable!() #[allow(deprecated)]
{
$crate::executable!()
}
} }
}) })
); );
@ -51,7 +55,10 @@ macro_rules! execution_phrase(
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(" ") .join(" ")
} else { } else {
$crate::executable!() #[allow(deprecated)]
{
$crate::executable!()
}
} }
}) })
); );