Based on the comments from @pmeunier in #561, I have completely re-wrote the inital patch to use the writeln!
rather than eprintln!
. This patch adds some fairly simple output for commands so that the user knows something has happened rather than being given no output at all :)
UAXGGNAZFUQX2XTVNITFZG54E2W5V4RKJUGEKN7WD2HDLVT5QG6QC
6U42MTEZTINWUU2KLJLQW33ZBZXKTHPTF6TMEG56TO642CQDZQMQC
H72JG6HLA7U3XFOUMWF6F3NFSWK5B6ZM6J5ZTILRSXBA7IM6H75AC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
Q7CHNDXNVJCBL2DK7LYZ6KSRFN4KO6TXKEP3GIWDJHB6JPSE3FUQC
RUBBHYZ7MCLKJIHZ3EWEC3JR3FSKOU4T2NH7KRBG7ECAU4JF3LUAC
I24UEJQLCH2SOXA4UHIYWTRDCHSOPU7AFTRUOTX7HZIAV4AZKYEQC
MU5GSJAW65PEG3BRYUKZ7O37BPHW3MOX3S5E2RFOXKGUOJEEDQ5AC
OU6JOR3CDZTH2H3NTGMV3WDIAWPD3VEJI7JRY3VJ7LPDR3QOA52QC
6F6AAHK4M2IVS23TVISR5OJSTZXUSEKLOP5BMM7SUHYG2FQNTSGQC
CCLLB7OIFNFYJZTG3UCI7536TOCWSCSXR67VELSB466R24WLJSDAC
4OCC6D42GZYRDLH3NSKXMJTRKXP7UZ6Z3YNGCNUT7NT6WBDBCBIAC
V435QOJRFHNKW3NKJHMVMFOGO3KGAZVSURLSGFUHVKOMHMF4Q2ZQC
EUZFFJSOWV4PXDFFPDAFBHFUUMOFEU6ST7JH57YYRRR2SEOXLN6QC
for pr in self.txn.reverse_log(&*self.channel_ref.read(), None)? {
let mut reverse_log = self.txn.reverse_log(&*self.channel_ref.read(), None)?.peekable();
if reverse_log.peek().is_none() {
let mut stderr = std::io::stderr();
writeln!(stderr, "No matching logs found")?;
return Ok(());
}
for pr in reverse_log {
// If the user calls `pijul add .`, the entire path will be stripped, so we must account for this edge case
if path.is_dir() || path_str == "" {
let display_str = if path.is_dir() {
path_str.clone()
} else {
".".to_string()
};
writeln!(stderr, "The directory `{}` has been recorded, but its contents will not be tracked (use --recursive to override)", display_str)?;
}