StdoutViewer: Implement view()

This commit is contained in:
Matthias Beyer 2016-03-06 11:49:19 +01:00
parent 68b2c152e3
commit f582ea9367

View file

@ -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!()
}
}
}