summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-10-11 00:13:30 +0200
committerMatthias Beyer <mail@beyermatthias.de>2018-11-06 20:35:18 +0100
commit860c58cbdfcb0a8229bcc60183b93be74da07b9f (patch)
tree0731911b881cb381d0bedee636b53d48e1a4f150
parenteceae358f8cce1b7f570641ce8b3d1b6df28e9b4 (diff)
Add ID reporting in imag-log
-rw-r--r--bin/domain/imag-log/src/main.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs
index 56d5018..5b6f01d 100644
--- a/bin/domain/imag-log/src/main.rs
+++ b/bin/domain/imag-log/src/main.rs
@@ -57,6 +57,7 @@ use libimagerror::trace::MapErrTrace;
use libimagerror::io::ToExitCode;
use libimagerror::exit::ExitUnwrap;
use libimagerror::iter::TraceIterator;
+use libimagerror::exit::ExitCode;
use libimagdiary::diary::Diary;
use libimaglog::log::Log;
use libimagstore::iter::get::StoreIdGetIteratorExtension;
@@ -156,7 +157,7 @@ fn show(rt: &Runtime) {
.into_iter()
.map(|(id, entry)| {
debug!("Found entry: {:?}", entry);
- writeln!(rt.stdout(),
+ let _ = writeln!(rt.stdout(),
"{dname: >10} - {y: >4}-{m:0>2}-{d:0>2}T{H:0>2}:{M:0>2} - {text}",
dname = id.diary_name(),
y = id.year(),
@@ -165,9 +166,14 @@ fn show(rt: &Runtime) {
H = id.hour(),
M = id.minute(),
text = entry.get_content())
- .to_exit_code()
+ .to_exit_code()?;
+
+ let _ = rt
+ .report_touched(entry.get_location())
+ .map_err_trace_exit_unwrap(1);
+ Ok(())
})
- .collect::<Result<Vec<()>, _>>()
+ .collect::<Result<Vec<()>, ExitCode>>()
.unwrap_or_exit();
}
}