1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

basename: improve error messages

Remove duplicated utility name from error messages
This commit is contained in:
bashi8128 2021-05-03 23:26:46 +09:00
parent 91c736bd95
commit 74802f9f0f

View file

@ -71,7 +71,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
if !matches.is_present(options::NAME) {
crash!(
1,
"{0}: {1}\nTry '{0} --help' for more information.",
"{1}\nTry '{0} --help' for more information.",
executable!(),
"missing operand"
);
@ -85,7 +85,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
if !multiple_paths && matches.occurrences_of(options::NAME) > 2 {
crash!(
1,
"{0}: extra operand '{1}'\nTry '{0} --help' for more information.",
"extra operand '{1}'\nTry '{0} --help' for more information.",
executable!(),
matches.values_of(options::NAME).unwrap().nth(2).unwrap()
);