feat!: report findings with exit code 4, not the code for failure

This commit is contained in:
2026-09-08 15:05:00 +00:00
parent 23b7fde0ea
commit d7a54c70f9
3 changed files with 17 additions and 21 deletions

View File

@@ -14,6 +14,9 @@ use clap::Parser;
use crate::ctx::Ctx;
use crate::output::note;
// 0 ran with nothing to report, 1 could not finish, 2 bad arguments, 4 found something
const FINDINGS: u8 = 4;
fn main() -> ExitCode {
let args = cli::Ahab::parse();
@@ -87,14 +90,15 @@ fn run(ctx: &Ctx, command: cli::Commands) -> Result<ExitCode> {
null,
exit_code,
store,
} => commands::link::check(
ctx,
&paths,
porcelain,
null,
exit_code,
store.root.as_deref(),
),
} => {
let exposed =
commands::link::check(ctx, &paths, porcelain, null, store.root.as_deref())?;
match exit_code && exposed {
true => Ok(ExitCode::from(FINDINGS)),
false => Ok(done),
}
}
},
cli::Commands::Status { store } => {
commands::status::status(ctx, store.root.as_deref())?;