feat!: report findings with exit code 4, not the code for failure
This commit is contained in:
20
src/main.rs
20
src/main.rs
@@ -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())?;
|
||||
|
||||
Reference in New Issue
Block a user