From f582ea9367be55ed116698664d53e3429c63c77a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 6 Mar 2016 11:49:19 +0100 Subject: [PATCH] StdoutViewer: Implement view() --- imag-view/src/viewer/stdout.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/imag-view/src/viewer/stdout.rs b/imag-view/src/viewer/stdout.rs index c36c0373..a42af1c1 100644 --- a/imag-view/src/viewer/stdout.rs +++ b/imag-view/src/viewer/stdout.rs @@ -1,5 +1,7 @@ use std::io::{Stdout, stdout}; +use toml::encode_str; + use viewer::{ViewInformation, Viewer}; pub struct StdoutViewer { @@ -17,7 +19,21 @@ impl StdoutViewer { impl Viewer for StdoutViewer { fn view(&self, vi: ViewInformation) { - unimplemented!() + if vi.view_copy { + unimplemented!(); + } + + if vi.view_header { + println!("{}", encode_str(vi.entry.get_header().header())); + } + + if vi.view_content { + println!("{}", vi.entry.get_content()); + } + + if vi.view_copy && !vi.keep_copy { + unimplemented!() + } } }