diff --git a/src/main.rs b/src/main.rs index d13436f..6d59b21 100644 --- a/src/main.rs +++ b/src/main.rs @@ -273,7 +273,7 @@ fn main() -> anyhow::Result { if let Some(path) = docket { let d = docket::load(std::path::Path::new(&path))?; print!("{}", d.render(&meaning_policy)); - return Ok(std::process::ExitCode::SUCCESS); + return Ok(exit_code_for(d.verdict)); } let visibility_policy = match visibility { Some(v) => VisibilityPolicy::load(std::path::Path::new(&v))?, diff --git a/tests/cli_test.rs b/tests/cli_test.rs index 1427ea7..98330e7 100644 --- a/tests/cli_test.rs +++ b/tests/cli_test.rs @@ -104,7 +104,9 @@ fn test_cli_adjudicate_load_docket() { .output() .expect("Failed to execute oot CLI"); - assert!(output.status.success()); + // fixtures/example.json is EMBARGOED, so loading it must exit nonzero, + // matching the non-docket adjudicate paths. Regression for CLI-01. + assert_eq!(output.status.code(), Some(1)); let stdout = String::from_utf8_lossy(&output.stdout); assert!(stdout.contains("OOT DOCKET"));