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:
commit
c08eae8e9a
1 changed files with 0 additions and 56 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue