Add ID reporting in imag-notes

This commit is contained in:
Matthias Beyer 2018-10-10 23:17:21 +02:00
parent 2ca6be8322
commit eceae358f8

View file

@ -109,6 +109,10 @@ fn create(rt: &Runtime) {
.map_warn_err_str("Editing failed")
.map_err_trace_exit_unwrap(1);
}
let _ = rt
.report_touched(note.get_location())
.map_err_trace_exit_unwrap(1);
}
fn delete(rt: &Runtime) {
@ -129,6 +133,10 @@ fn edit(rt: &Runtime) {
.edit_content(rt)
.map_warn_err_str("Editing failed")
.map_err_trace_exit_unwrap(1);
let _ = rt
.report_touched(note.get_location())
.map_err_trace_exit_unwrap(1);
})
.unwrap_or_else(|| {
error!("Cannot find note with name '{}'", name);
@ -156,9 +164,13 @@ fn list(rt: &Runtime) {
.iter()
.for_each(|note| {
let name = note.get_name().map_err_trace_exit_unwrap(1);
writeln!(rt.stdout(), "{}", name)
let _ = writeln!(rt.stdout(), "{}", name)
.to_exit_code()
.unwrap_or_exit()
.unwrap_or_exit();
let _ = rt
.report_touched(note.get_location())
.map_err_trace_exit_unwrap(1);
});
}