mod fixture_reuse_driver;
mod fixture_reuse_protocol;
mod fixture_reuse_report;
use std::process::ExitCode;
use fixture_reuse_driver::Error;
fn main() -> ExitCode {
match fixture_reuse_driver::run() {
Ok(()) => ExitCode::SUCCESS,
Err(error) => {
eprintln!("error: {error}");
match error {
Error::InvalidArgument(_) => ExitCode::from(2),
Error::Interrupted => ExitCode::from(130),
Error::Tool(error)
if matches!(error.as_ref(), ic_host_process::tool::ToolError::Execution(execution)
if matches!(execution.failure, ic_host_process::tool::ExecutionFailure::Cancelled)) =>
{
ExitCode::from(130)
}
_ => ExitCode::FAILURE,
}
}
}
}