Unify unknown command and subcommand exit code classification

This commit is contained in:
gitea committed 2026-09-11 10:02:50 +08:00
1 parent bda8b82157
commit 225321f34a
5 files changed
+80 -61

No files matched your search

+8
View File
@@ -28,4 +28,12 @@ describe("CLI runner", () => {
expect(result.exitCode).toBe(2);
expect(result.stderr).toContain("Invalid JSON:");
});
test("returns usage exit code 2 for unknown subcommands across domains", async () => {
const result = await runCli(["contacts", "not-a-subcommand"]);
expect(result.isError).toBe(true);
expect(result.exitCode).toBe(2);
expect(result.stderr).toContain("Unknown contacts command: not-a-subcommand");
});
});