summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-07-14 13:40:28 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-07-14 13:40:28 +0200
commitd53e30645980c3da9a887deaa7965168b99fa7a8 (patch)
tree9e0743f14551e1c716f4d69bbd47f183716ad92d
parentba77f5e8babfc25857587bfa5979700bacdb636d (diff)
parentb5d439cef7677d8beb31e20b886728305e0c4b20 (diff)
downloadimag-d53e30645980c3da9a887deaa7965168b99fa7a8.zip
imag-d53e30645980c3da9a887deaa7965168b99fa7a8.tar.gz
Merge branch 'imag-diagnostics-more-output' into master
-rw-r--r--bin/core/imag-diagnostics/src/main.rs14
-rw-r--r--bin/core/imag-diagnostics/src/ui.rs9
2 files changed, 19 insertions, 4 deletions
diff --git a/bin/core/imag-diagnostics/src/main.rs b/bin/core/imag-diagnostics/src/main.rs
index 5a69c7a..bef0b15 100644
--- a/bin/core/imag-diagnostics/src/main.rs
+++ b/bin/core/imag-diagnostics/src/main.rs
@@ -126,8 +126,9 @@ fn main() {
"Print diagnostics about imag and the imag store",
ui::build_ui);
- let template = get_config(&rt, "rt.progressbar_style");
- let tick_chars = get_config(&rt, "rt.progressticker_chars");
+ let template = get_config(&rt, "rt.progressbar_style");
+ let tick_chars = get_config(&rt, "rt.progressticker_chars");
+ let verbose = rt.cli().is_present("more-output");
let style = if let Some(tick_chars) = tick_chars {
ProgressStyle::default_spinner().tick_chars(&tick_chars)
@@ -176,6 +177,7 @@ fn main() {
let mut max_overall_byte_size : Option<(usize, StoreId)> = None;
let mut verified_count = 0;
let mut unverified_count = 0;
+ let mut unverified_entries = vec![];
let mut num_links = 0;
let mut max_links : Option<(usize, StoreId)> = None;
@@ -197,6 +199,9 @@ fn main() {
verified_count += 1;
} else {
unverified_count += 1;
+ if verbose {
+ unverified_entries.push(diag.id.clone());
+ }
}
num_links += diag.num_links;
@@ -239,6 +244,11 @@ fn main() {
}
do_write!(out, "{} verified entries", verified_count);
do_write!(out, "{} unverified entries", unverified_count);
+ if verbose {
+ for unve in unverified_entries.iter() {
+ do_write!(out, "Unverified: {}", unve);
+ }
+ }
}
}
diff --git a/bin/core/imag-diagnostics/src/ui.rs b/bin/core/imag-diagnostics/src/ui.rs
index f0faad3..9e0c3e6 100644
--- a/bin/core/imag-diagnostics/src/ui.rs
+++ b/bin/core/imag-diagnostics/src/ui.rs
@@ -17,9 +17,14 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
-use clap::App;
+use clap::{Arg, App};
pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
- app
+ app.arg(Arg::with_name("more-output")
+ .long("more")
+ .takes_value(false)
+ .required(false)
+ .multiple(false)
+ .help("Show more output."))
}