aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-10-29 14:33:28 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-10-29 14:33:28 -0700
commita0f70605c5f8987f518714548267af87add646b2 (patch)
tree41b8bbbaa69421aaee0b0eb420e126027aacf24c /src/bin
parent4a87b60ecf2f5e558235c41c8929ce264830c147 (diff)
downloadgeniza-a0f70605c5f8987f518714548267af87add646b2.tar.gz
geniza-a0f70605c5f8987f518714548267af87add646b2.zip
pretty print log output
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/geniza-drive.rs14
1 files changed, 13 insertions, 1 deletions
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());
+ }
}
}
_ => {