From 66c1d629a42dae167f54a9ee82a73927da93fbc0 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Fri, 10 Sep 2021 15:45:50 +0800 Subject: [PATCH] [all (rust)] Keep silent if --quiet was applied --- src/bin/cache_check.rs | 4 ++-- src/bin/cache_repair.rs | 4 ++-- src/bin/cache_restore.rs | 4 ++-- src/bin/thin_check.rs | 4 ++-- src/bin/thin_dump.rs | 4 ++-- src/bin/thin_repair.rs | 4 ++-- src/bin/thin_restore.rs | 4 ++-- src/bin/thin_shrink.rs | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/bin/cache_check.rs b/src/bin/cache_check.rs index e85057b..d37c07a 100644 --- a/src/bin/cache_check.rs +++ b/src/bin/cache_check.rs @@ -93,11 +93,11 @@ fn main() { skip_discards: matches.is_present("SKIP_DISCARDS"), ignore_non_fatal: matches.is_present("IGNORE_NON_FATAL"), auto_repair: matches.is_present("AUTO_REPAIR"), - report, + report: report.clone(), }; if let Err(reason) = check(opts) { - eprintln!("{}", reason); + report.fatal(&format!("{}", reason)); process::exit(1); } } diff --git a/src/bin/cache_repair.rs b/src/bin/cache_repair.rs index 8252b6b..646516b 100644 --- a/src/bin/cache_repair.rs +++ b/src/bin/cache_repair.rs @@ -68,11 +68,11 @@ fn main() { input: &input_file, output: &output_file, async_io: matches.is_present("ASYNC_IO"), - report, + report: report.clone(), }; if let Err(reason) = repair(opts) { - eprintln!("{}", reason); + report.fatal(&format!("{}", reason)); process::exit(1); } } diff --git a/src/bin/cache_restore.rs b/src/bin/cache_restore.rs index c209176..66b8359 100644 --- a/src/bin/cache_restore.rs +++ b/src/bin/cache_restore.rs @@ -73,11 +73,11 @@ fn main() { input: &input_file, output: &output_file, async_io: matches.is_present("ASYNC_IO"), - report, + report: report.clone(), }; if let Err(reason) = restore(opts) { - eprintln!("{}", reason); + report.fatal(&format!("{}", reason)); process::exit(1); } } diff --git a/src/bin/thin_check.rs b/src/bin/thin_check.rs index 371dd21..d04cc62 100644 --- a/src/bin/thin_check.rs +++ b/src/bin/thin_check.rs @@ -131,11 +131,11 @@ fn main() { ignore_non_fatal: matches.is_present("IGNORE_NON_FATAL"), auto_repair: matches.is_present("AUTO_REPAIR"), clear_needs_check: matches.is_present("CLEAR_NEEDS_CHECK"), - report, + report: report.clone(), }; if let Err(reason) = check(opts) { - eprintln!("{}", reason); + report.fatal(&format!("{}", reason)); process::exit(1); } } diff --git a/src/bin/thin_dump.rs b/src/bin/thin_dump.rs index 59ac543..0a6a8b8 100644 --- a/src/bin/thin_dump.rs +++ b/src/bin/thin_dump.rs @@ -128,7 +128,7 @@ fn main() { input: input_file, output: output_file, async_io: matches.is_present("ASYNC_IO"), - report, + report: report.clone(), repair: matches.is_present("REPAIR"), overrides: SuperblockOverrides { transaction_id, @@ -138,7 +138,7 @@ fn main() { }; if let Err(reason) = dump(opts) { - eprintln!("{}", reason); + report.fatal(&format!("{}", reason)); process::exit(1); } } diff --git a/src/bin/thin_repair.rs b/src/bin/thin_repair.rs index 188f874..d2de7a3 100644 --- a/src/bin/thin_repair.rs +++ b/src/bin/thin_repair.rs @@ -108,7 +108,7 @@ fn main() { input: &input_file, output: &output_file, async_io: matches.is_present("ASYNC_IO"), - report, + report: report.clone(), overrides: SuperblockOverrides { transaction_id, data_block_size, @@ -117,7 +117,7 @@ fn main() { }; if let Err(reason) = repair(opts) { - eprintln!("{}", reason); + report.fatal(&format!("{}", reason)); process::exit(1); } } diff --git a/src/bin/thin_restore.rs b/src/bin/thin_restore.rs index 125e148..be471d8 100644 --- a/src/bin/thin_restore.rs +++ b/src/bin/thin_restore.rs @@ -73,11 +73,11 @@ fn main() { input: &input_file, output: &output_file, async_io: matches.is_present("ASYNC_IO"), - report, + report: report.clone(), }; if let Err(reason) = restore(opts) { - eprintln!("{}", reason); + report.fatal(&format!("{}", reason)); process::exit(1); } } diff --git a/src/bin/thin_shrink.rs b/src/bin/thin_shrink.rs index fc452da..e61ed5b 100644 --- a/src/bin/thin_shrink.rs +++ b/src/bin/thin_shrink.rs @@ -74,7 +74,7 @@ fn main() { if let Err(reason) = thinp::shrink::toplevel::shrink(&input_file, &output_file, &data_file, size, do_copy) { - println!("Application error: {}\n", reason); + eprintln!("Application error: {}\n", reason); exit(1); } }