diff options
Diffstat (limited to 'bin/core/imag-ids/src/main.rs')
-rw-r--r-- | bin/core/imag-ids/src/main.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/bin/core/imag-ids/src/main.rs b/bin/core/imag-ids/src/main.rs index 72c07b6a..b0b84199 100644 --- a/bin/core/imag-ids/src/main.rs +++ b/bin/core/imag-ids/src/main.rs @@ -118,23 +118,27 @@ fn main() { } }) .map(|id| if print_storepath { - id + (Some(rt.store().path()), id) } else { - id.without_base() + (None, id) }); let mut stdout = rt.stdout(); trace!("Got output: {:?}", stdout); - iterator.for_each(|id| { - let _ = rt.report_touched(&id).unwrap_or_exit(); // .map_err_trace_exit_unwrap(); - + iterator.for_each(|(storepath, id)| { + rt.report_touched(&id).unwrap_or_exit(); if !rt.output_is_pipe() { let id = id.to_str().map_err_trace_exit_unwrap(); trace!("Writing to {:?}", stdout); - writeln!(stdout, "{}", id) - .to_exit_code() - .unwrap_or_exit(); + + let result = if let Some(store) = storepath { + writeln!(stdout, "{}/{}", store.display(), id) + } else { + writeln!(stdout, "{}", id) + }; + + result.to_exit_code().unwrap_or_exit(); } }) } |