From a0f70605c5f8987f518714548267af87add646b2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sun, 29 Oct 2017 14:33:28 -0700 Subject: pretty print log output --- src/bin/geniza-drive.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/bin') diff --git a/src/bin/geniza-drive.rs b/src/bin/geniza-drive.rs index 05c7fb7..8e236f7 100644 --- a/src/bin/geniza-drive.rs +++ b/src/bin/geniza-drive.rs @@ -55,7 +55,19 @@ fn run() -> Result<()> { ("log", Some(_subm)) => { let mut drive = DatDrive::open(dir, false)?; for entry in drive.history(1) { - println!("{:?}", entry?); + let entry = entry?; + if let Some(stat) = entry.stat { + if stat.get_blocks() == 0 { + println!("{}\t[chg] {}", + entry.index, entry.path.display()); + } else { + println!("{}\t[put] {}\t{} bytes ({} blocks)", + entry.index, entry.path.display(), stat.get_size(), stat.get_blocks()); + } + } else { + println!("{}\t[del] {}", + entry.index, entry.path.display()); + } } } _ => { -- cgit v1.2.3