M0.9: --help wins over an earlier bad option (#1155)

Review: `mcp --bogus --help` stopped at --bogus with exit 2. The parser
now keeps the first bad option and reports it only when no --help or -h
follows.
This commit is contained in:
Gert Pellin
2026-10-22 21:45:29 +02:00
parent 40315a123d
commit bb2e56a7ea
2 changed files with 18 additions and 8 deletions
+1
View File
@@ -60,6 +60,7 @@ fn help_after_a_subcommand_prints_the_usage() {
&["plugin", "publish", "--help"],
&["perf", "--help"],
&["mcp", "--attach", "notaport", "--help"],
&["mcp", "--bogus", "--help"],
] {
let out = bin().args(args).stdin(Stdio::null()).output().unwrap();
assert_eq!(out.status.code(), Some(0), "{args:?}: {}", String::from_utf8_lossy(&out.stderr));