Adopt pinned public core snapshot and prepare Sized 2.0.0
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
use sized::{scan_tree, ScanControl, ScanOptions};
|
||||
use std::{error::Error, path::PathBuf};
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let Some(path) = std::env::args_os().nth(1).map(PathBuf::from) else {
|
||||
eprintln!("Usage: scan PATH");
|
||||
std::process::exit(2);
|
||||
};
|
||||
let report = scan_tree(&path, &ScanOptions::default(), &ScanControl::default())?;
|
||||
println!(
|
||||
"apparent={} allocated={} entries={} complete={} issues={}",
|
||||
report.root.size_bytes,
|
||||
report.root.blocks * 512,
|
||||
report.entries_scanned,
|
||||
report.root.complete,
|
||||
report.issues.len()
|
||||
);
|
||||
if !report.root.complete {
|
||||
for issue in report.issues {
|
||||
eprintln!("{}: {}", issue.path.display(), issue.message);
|
||||
}
|
||||
std::process::exit(1);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user