mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07: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:
@@ -20,6 +20,7 @@ macro_rules! executable_os(
|
||||
|
||||
/// Get the executable path (as `String`).
|
||||
#[macro_export]
|
||||
#[deprecated = "Use util_name!() or execution_phrase!() instead"]
|
||||
macro_rules! executable(
|
||||
() => ({
|
||||
$crate::executable_os!().to_string_lossy().to_string()
|
||||
@@ -33,7 +34,10 @@ macro_rules! util_name(
|
||||
if $crate::get_utility_is_second_arg() {
|
||||
$crate::args_os().nth(1).unwrap().to_string_lossy().to_string()
|
||||
} else {
|
||||
$crate::executable!()
|
||||
#[allow(deprecated)]
|
||||
{
|
||||
$crate::executable!()
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
@@ -51,7 +55,10 @@ macro_rules! execution_phrase(
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ")
|
||||
} else {
|
||||
$crate::executable!()
|
||||
#[allow(deprecated)]
|
||||
{
|
||||
$crate::executable!()
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user