diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/geniza-drive.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bin/geniza-drive.rs b/src/bin/geniza-drive.rs index 32104e4..79ad517 100644 --- a/src/bin/geniza-drive.rs +++ b/src/bin/geniza-drive.rs @@ -37,6 +37,10 @@ fn run() -> Result<()> { SubCommand::with_name("verify") .about("Checks signatures et al") ) + .subcommand( + SubCommand::with_name("dump-entries") + .about("Dump all entries in a debug-friendly format") + ) .get_matches(); let dir = Path::new(matches.value_of("dat-dir").unwrap()); @@ -70,6 +74,21 @@ fn run() -> Result<()> { let mut drive = DatDrive::open(dir, false)?; println!("{:?}", drive.verify()); } + ("dump-entries", Some(_subm)) => { + let mut drive = DatDrive::open(dir, false)?; + for entry in drive.history(0) { + let entry = entry?; + println!("{}\tpath: {}", + entry.index, entry.path.display()); + println!("\tchildren: {:?}", + entry.children); + if let Some(_) = entry.stat { + println!("\tstat: Some (add/change)"); + } else { + println!("\tstat: None (delete)"); + } + } + } _ => { println!("Missing or unimplemented command!"); println!("{}", matches.usage()); |