diff --git a/apps/filmcraft-cli/src/main.rs b/apps/filmcraft-cli/src/main.rs index 10592444..3040d434 100644 --- a/apps/filmcraft-cli/src/main.rs +++ b/apps/filmcraft-cli/src/main.rs @@ -468,7 +468,7 @@ async fn cli() { usage(format!("unknown mcp option `{opt}`")); } let server = match a.opt("--bridge") { - Some(addr) => filmcraft_automation::FilmcraftMcp::bridge(addr).unwrap_or_else(|e| fail(e)), + Some(addr) => filmcraft_automation::FilmcraftMcp::bridge(addr).unwrap_or_else(|e| usage(e)), None => match Backend::open(&a) { Backend::Local(s) => filmcraft_automation::FilmcraftMcp::headless(*s), Backend::Bridge(_) => usage("mcp: use --bridge ADDR to drive a running app"), diff --git a/apps/filmcraft-cli/tests/cli.rs b/apps/filmcraft-cli/tests/cli.rs index 8552cc64..5548d6c6 100644 --- a/apps/filmcraft-cli/tests/cli.rs +++ b/apps/filmcraft-cli/tests/cli.rs @@ -22,6 +22,9 @@ fn help_and_usage_errors() { assert_eq!(cli(&[]).status.code(), Some(2)); assert_eq!(cli(&["frobnicate"]).status.code(), Some(2)); assert_eq!(cli(&["exec", "file.newBin", "notkv"]).status.code(), Some(2)); + // Invalid --bridge is a usage error (exit 2) for both exec and mcp (#921). + assert_eq!(cli(&["--bridge", "0.0.0.0:9876", "exec", "inspect.project"]).status.code(), Some(2)); + assert_eq!(cli(&["mcp", "--bridge", "0.0.0.0:9876"]).status.code(), Some(2)); } #[test]