Unify unknown command and subcommand exit code classification
This commit is contained in:
1 parent
bda8b82157
commit
225321f34a
5 files changed
+80
-61
No files matched your search
@@ -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");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user