Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/common/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// spell-checker:ignore prefixcat testcat

use std::ffi::{OsStr, OsString};
use std::io::{Write, stderr};
use std::path::{Path, PathBuf};
use std::process;

Expand All @@ -25,13 +26,18 @@ pub fn get_all_utilities<T: Args>(

/// Prints a "utility not found" error and exits
pub fn not_found(util: &OsStr) -> ! {
eprintln!("{}: function/utility not found", util.maybe_quote());
let _ = writeln!(
stderr(),
"coreutils: unknown program '{}'",
util.maybe_quote()
);
process::exit(1);
}

/// Prints an "unrecognized option" error and exits
pub fn unrecognized_option(binary_name: &str, option: &OsStr) -> ! {
eprintln!(
let _ = writeln!(
stderr(),
"{}: unrecognized option '{}'",
binary_name,
option.to_string_lossy()
Expand Down
2 changes: 0 additions & 2 deletions util/build-gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ sed -i 's/^print_ver_.*/require_selinux_/' tests/chcon/chcon-fail.sh

# We use coreutils yes
sed -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh
# Different message
sed -i "s|coreutils: unknown program 'blah'|blah: function/utility not found|" tests/misc/coreutils.sh

# Use the system coreutils where the test fails due to error in a util that is not the one being tested
sed -i "s|grep '^#define HAVE_CAP 1' \$CONFIG_HEADER > /dev/null|true|" tests/ls/capability.sh
Expand Down
Loading