summaryrefslogtreecommitdiff
path: root/bin/core/imag-store
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-02-26 22:57:17 +0100
committerMatthias Beyer <mail@beyermatthias.de>2018-03-04 13:57:44 +0100
commit50461b839acba753cae899c137ea364649cfd5b9 (patch)
tree3c4ab618581de6f0787ee3ec67e0a682c0d21513 /bin/core/imag-store
parentc18c0bbbe455119c935510bd6fb65292e97950b1 (diff)
downloadimag-50461b839acba753cae899c137ea364649cfd5b9.zip
imag-50461b839acba753cae899c137ea364649cfd5b9.tar.gz
Use output stream from Runtime::stdout()
Diffstat (limited to 'bin/core/imag-store')
-rw-r--r--bin/core/imag-store/src/retrieve.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/bin/core/imag-store/src/retrieve.rs b/bin/core/imag-store/src/retrieve.rs
index 20dc100..ea89513 100644
--- a/bin/core/imag-store/src/retrieve.rs
+++ b/bin/core/imag-store/src/retrieve.rs
@@ -51,11 +51,9 @@ pub fn retrieve(rt: &Runtime) {
}
pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
- let mut out = ::std::io::stdout();
-
if do_print_raw(scmd) {
debug!("Printing raw content...");
- let _ = writeln!(out, "{}", e.to_str())
+ let _ = writeln!(rt.stdout(), "{}", e.to_str())
.to_exit_code()
.unwrap_or_exit();
} else if do_filter(scmd) {
@@ -74,7 +72,7 @@ pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
unimplemented!()
} else {
debug!("Printing header as TOML...");
- let _ = writeln!(out, "{}", e.get_header())
+ let _ = writeln!(rt.stdout(), "{}", e.get_header())
.to_exit_code()
.unwrap_or_exit();
}
@@ -82,7 +80,7 @@ pub fn print_entry(rt: &Runtime, scmd: &ArgMatches, e: FileLockEntry) {
if do_print_content(scmd) {
debug!("Printing content...");
- let _ = writeln!(out, "{}", e.get_content())
+ let _ = writeln!(rt.stdout(), "{}", e.get_content())
.to_exit_code()
.unwrap_or_exit();
}