fix(cli): drive mcp doctor help from a single option schema
Parses rea mcp doctor arguments against one zod option schema that is also the help renderer's source of truth, answering --help/-h in any position without starting a diagnostic session and keeping actionable errors for unknown options and invalid formats. Updates the landed help assertion to the schema-rendered format list and adds boundary coverage for help positioning and --format edge cases.
This commit is contained in:
@@ -45,7 +45,7 @@ it("shows MCP doctor help without starting a server and keeps option errors acti
|
||||
const help = await runCli(["mcp", "doctor", "--help"]);
|
||||
expect(help.exitCode).toBe(0);
|
||||
expect(help.stdout).toContain("Usage: rea mcp doctor [options]");
|
||||
expect(help.stdout).toContain("--format <format>");
|
||||
expect(help.stdout).toContain("--format <toon|json|yaml|md|jsonl>");
|
||||
expect(help.stdout).toContain("--full-output");
|
||||
|
||||
const invalid = await runCli(["mcp", "doctor", "--not-an-option"]);
|
||||
|
||||
Reference in New Issue
Block a user