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