use clap::Parser;
fn main() {
let cli = tix::cli::Cli::parse();
let code = tix::cli::run(cli);
// Drained here rather than in each command. Draining per command was tried
// and reached only `link` and `edit`, so every other write path — `mv`,
// `rollover`, planning, sync, the TUI, MCP — warned about nothing, and a
// disclosure raised by one of them was silently attributed to whichever
// command drained next. A write path cannot forget to drain if the surface
// it belongs to drains once.
for line in tix::storage::take_disclosures() {
eprintln!(
"{}",
tix::diagnostics::Diagnostic::warning("W-tix-disclosure", line).render_auto()
);
}
std::process::exit(i32::from(code));
}