drop print-failures arg

This commit is contained in:
Bryson Steck 2025-07-20 18:02:47 -06:00
parent 6f0c2c0f44
commit f7bf013f2b
Signed by: bryson
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4

View file

@ -118,13 +118,6 @@ struct Args {
long,
help = "(only used with -c) Only print checksums that fail; do not print OK for files that are successful"
)]
failures_only: bool,
#[arg(
short = 'Q',
long,
help = "(only used with -c) Suppress all output to stdout, including failures"
)]
quiet: bool,
#[arg(trailing_var_arg = true)]
@ -134,7 +127,6 @@ struct Args {
struct ThreadInfo {
debug: bool,
quiet: bool,
print_failures: bool,
thread_id: usize,
filenames: Arc<Mutex<VecDeque<PathBuf>>>,
algorithm: Arc<String>,
@ -166,7 +158,7 @@ fn hash(info: ThreadInfo) -> Result<(), String> {
let file = match File::open(&filename) {
Err(e) => {
common::error(format!("{}: {}", filename.as_path().display(), e));
println!("{}: FAILED ({})", filename.as_path().display(), e);
info.file_errors.fetch_add(1, Ordering::SeqCst);
continue;
},
@ -223,8 +215,10 @@ fn hash(info: ThreadInfo) -> Result<(), String> {
match &info.hash_map {
Some(h) => {
if h.lock().unwrap()[&filename] == res && !info.quiet {
println!("{}: OK", filename.as_path().display());
if h.lock().unwrap()[&filename] == res {
if !info.quiet {
println!("{}: OK", filename.as_path().display());
}
} else {
println!("{}: FAILED", filename.as_path().display());
info.hash_errors.fetch_add(1, Ordering::SeqCst);
@ -250,7 +244,6 @@ fn verify(
algorithm: String,
debug: bool,
quiet: bool,
print_failures: bool,
checksum_files: Vec<PathBuf>,
) -> (
Vec<JoinHandle<Result<(), std::string::String>>>,
@ -296,7 +289,6 @@ fn verify(
hash(ThreadInfo {
debug,
quiet,
print_failures,
thread_id: i,
filenames: safe_buf,
algorithm: safe_alg,
@ -334,7 +326,6 @@ fn generate(
hash(ThreadInfo {
debug,
quiet,
print_failures: false,
thread_id: i,
filenames: safe_buf,
algorithm: safe_alg,
@ -373,14 +364,7 @@ fn main() {
let arc_fe;
let arc_he;
if &args.check.len() >= &1 {
(handles, arc_fe, arc_he) = verify(
cpus,
args.algorithm,
args.debug,
args.quiet,
args.failures_only,
args.check,
);
(handles, arc_fe, arc_he) = verify(cpus, args.algorithm, args.debug, args.quiet, args.check);
} else {
let mut buffer = VecDeque::new();
for file in args.files {