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

Merge pull request #2276 from ycd/clear-macros

uucore: delete unused macros
This commit is contained in:
Sylvestre Ledru 2021-05-26 13:45:30 +02:00 committed by GitHub
commit c08eae8e9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,13 +167,6 @@ macro_rules! msg_invalid_input {
};
}
#[macro_export]
macro_rules! snippet_no_file_at_path {
($path:expr) => {
format!("nonexistent path {}", $path)
};
}
// -- message templates : invalid input : flag
#[macro_export]
@ -220,55 +213,6 @@ macro_rules! msg_opt_invalid_should_be {
};
}
// -- message templates : invalid input : args
#[macro_export]
macro_rules! msg_arg_invalid_value {
($expects:expr, $received:expr) => {
msg_invalid_input!(format!(
"expects its argument to be {}, but was provided {}",
$expects, $received
))
};
}
#[macro_export]
macro_rules! msg_args_invalid_value {
($expects:expr, $received:expr) => {
msg_invalid_input!(format!(
"expects its arguments to be {}, but was provided {}",
$expects, $received
))
};
($msg:expr) => {
msg_invalid_input!($msg)
};
}
#[macro_export]
macro_rules! msg_args_nonexistent_file {
($received:expr) => {
msg_args_invalid_value!("paths to files", snippet_no_file_at_path!($received))
};
}
#[macro_export]
macro_rules! msg_wrong_number_of_arguments {
() => {
msg_args_invalid_value!("wrong number of arguments")
};
($min:expr, $max:expr) => {
msg_args_invalid_value!(format!("expects {}-{} arguments", $min, $max))
};
($exact:expr) => {
if $exact == 1 {
msg_args_invalid_value!("expects 1 argument")
} else {
msg_args_invalid_value!(format!("expects {} arguments", $exact))
}
};
}
// -- message templates : invalid input : input combinations
#[macro_export]