mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
Merge pull request #816 from nathanross/minor-fixes
basename: error message for too few or many args messages should go to stderr
This commit is contained in:
commit
76cfcba306
1 changed files with 12 additions and 6 deletions
|
@ -52,15 +52,21 @@ pub fn uumain(args: Vec<String>) -> i32 {
|
||||||
|
|
||||||
// too few arguments
|
// too few arguments
|
||||||
if args.len() < 2 {
|
if args.len() < 2 {
|
||||||
println!("{}: {}", NAME, "missing operand");
|
crash!(
|
||||||
println!("Try '{} --help' for more information.", NAME);
|
1,
|
||||||
return 1;
|
"{0}: {1}\nTry '{0} --help' for more information.",
|
||||||
|
NAME,
|
||||||
|
"missing operand"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// too many arguments
|
// too many arguments
|
||||||
else if args.len() > 3 {
|
else if args.len() > 3 {
|
||||||
println!("{}: extra operand '{}'", NAME, args[3]);
|
crash!(
|
||||||
println!("Try '{} --help' for more information.", NAME);
|
1,
|
||||||
return 1;
|
"{0}: extra operand '{1}'\nTry '{0} --help' for more information.",
|
||||||
|
NAME,
|
||||||
|
args[3]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue