#[cfg(feature = "dhat-heap")]
#[global_allocator]
static ALLOC: dhat::Alloc = dhat::Alloc;
fn main() {
#[cfg(feature = "dhat-heap")]
let _profiler = dhat::Profiler::new_heap();
let Some(path) = std::env::args_os().nth(1) else {
eprintln!("usage: profile_pipeline <ledger.beancount>");
std::process::exit(2);
};
let options = rustledger_loader::LoadOptions {
run_plugins: true,
validate: true,
..Default::default()
};
match rustledger_loader::load(std::path::Path::new(&path), &options) {
Ok(ledger) => {
eprintln!(
"processed {} directives ({} pipeline errors)",
ledger.directives.len(),
ledger.errors.len()
);
}
Err(e) => {
eprintln!("load/process failed: {e}");
std::process::exit(1);
}
}
}