Merge pull request #555 from matthiasbeyer/imag-view/fixes

Imag view/fixes
This commit is contained in:
Matthias Beyer 2016-07-16 22:40:48 +02:00 committed by GitHub
commit 29d10361b3
3 changed files with 7 additions and 1 deletions

View file

@ -52,6 +52,11 @@ fn main() {
let entry_id = rt.cli().value_of("id").unwrap(); // enforced by clap 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 rt.cli().is_present("versions") {
if let Err(e) = view_versions_of(entry_id, &rt) { if let Err(e) = view_versions_of(entry_id, &rt) {
trace_error(&e); trace_error(&e);

View file

@ -14,7 +14,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.long("version") .long("version")
.short("V") .short("V")
.takes_value(true) .takes_value(true)
.required(false) .required(true)
.help("View this version (youngest if not specified)") .help("View this version (youngest if not specified)")
.value_name("VERSION")) .value_name("VERSION"))

View file

@ -24,6 +24,7 @@ impl Viewer for StdoutViewer {
} }
if vi.view_header { if vi.view_header {
debug!("Going to display header: {:?}", vi.entry.get_header().header());
println!("{}", encode_str(vi.entry.get_header().header())); println!("{}", encode_str(vi.entry.get_header().header()));
} }