| 1 | use onestore::Store; |
| 2 | use std::{env, fs}; |
| 3 | |
| 4 | fn main() -> Result<(), Box<dyn std::error::Error>> { |
| 5 | for path in env::args_os().skip(1) { |
| 6 | let bytes = fs::read(&path)?; |
| 7 | let store = Store::parse(&bytes)?; |
| 8 | let nodes: usize = store.lists.values().map(|list| list.nodes.len()).sum(); |
| 9 | println!( |
| 10 | "{:?}: {:?}, {} transactions, {} lists, {nodes} nodes, {} checksum mismatches", |
| 11 | path, |
| 12 | store.header.file_type, |
| 13 | store.header.transaction_count, |
| 14 | store.lists.len(), |
| 15 | store.checksum_mismatches.len() |
| 16 | ); |
| 17 | } |
| 18 | Ok(()) |
| 19 | } |