Merge pull request #9588 from oech3/patch-6

coreutils: Print utility not found to stderr
This commit is contained in:
Daniel Hofstetter 2025-12-07 13:29:36 +01:00 committed by GitHub
commit eda7caec73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -25,7 +25,7 @@ pub fn get_all_utilities<T: Args>(
/// Prints a "utility not found" error and exits
pub fn not_found(util: &OsStr) -> ! {
println!("{}: function/utility not found", util.maybe_quote());
eprintln!("{}: function/utility not found", util.maybe_quote());
process::exit(1);
}

View file

@ -195,9 +195,9 @@ fn util_invalid_name_invalid_command() {
.unwrap();
let output = child.wait_with_output().unwrap();
assert_eq!(output.status.code(), Some(1));
assert_eq!(output.stderr, b"");
assert_eq!(output.stdout, b"");
assert_eq!(
output.stdout,
output.stderr,
b"definitely_invalid: function/utility not found\n"
);
}