From b6f467042f904e0380826adf2655c933765b1658 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Jul 2016 20:06:45 +0200 Subject: [PATCH 1/3] Add debugging output in header viewer --- imag-view/src/viewer/stdout.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/imag-view/src/viewer/stdout.rs b/imag-view/src/viewer/stdout.rs index a42af1c1..18536da6 100644 --- a/imag-view/src/viewer/stdout.rs +++ b/imag-view/src/viewer/stdout.rs @@ -24,6 +24,7 @@ impl Viewer for StdoutViewer { } if vi.view_header { + debug!("Going to display header: {:?}", vi.entry.get_header().header()); println!("{}", encode_str(vi.entry.get_header().header())); } From 616858bd282468c434696fd4214da48385369b82 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Jul 2016 20:07:40 +0200 Subject: [PATCH 2/3] Version part should be enforced --- imag-view/src/ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imag-view/src/ui.rs b/imag-view/src/ui.rs index 54979f1f..45c05ed1 100644 --- a/imag-view/src/ui.rs +++ b/imag-view/src/ui.rs @@ -14,7 +14,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .long("version") .short("V") .takes_value(true) - .required(false) + .required(true) .help("View this version (youngest if not specified)") .value_name("VERSION")) From 2646894bd36f6889715957515ea7488523e45843 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Jul 2016 20:07:53 +0200 Subject: [PATCH 3/3] Abort if the passed id contains a version part --- imag-view/src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imag-view/src/main.rs b/imag-view/src/main.rs index 2fa7802b..16cc0b91 100644 --- a/imag-view/src/main.rs +++ b/imag-view/src/main.rs @@ -52,6 +52,11 @@ fn main() { let entry_id = rt.cli().value_of("id").unwrap(); // enforced by clap + if entry_id.contains("~") { + error!("The --id argument does not need the version part"); + exit(1); + } + if rt.cli().is_present("versions") { if let Err(e) = view_versions_of(entry_id, &rt) { trace_error(&e);