fix(cli): reject unknown command help roots (#81083) (thanks @YB0y) · openclaw/openclaw@bec7d56
YB0y
·
2026-05-26
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -672,6 +672,26 @@ describe("runCli exit behavior", () => {
|
672 | 672 | expect(registerPluginCliCommandsFromValidatedConfigMock).not.toHaveBeenCalled(); |
673 | 673 | }); |
674 | 674 | |
| 675 | +it("rejects unowned command roots even when --help is appended (regression for #81077)", async () => { |
| 676 | +await expect(runCli(["node", "openclaw", "foo", "--help"])).rejects.toThrow( |
| 677 | +'No built-in command or plugin CLI metadata owns "foo"', |
| 678 | +); |
| 679 | + |
| 680 | +expect(startProxyMock).not.toHaveBeenCalled(); |
| 681 | +expect(tryRouteCliMock).not.toHaveBeenCalled(); |
| 682 | +expect(buildProgramMock).not.toHaveBeenCalled(); |
| 683 | +expect(registerPluginCliCommandsFromValidatedConfigMock).not.toHaveBeenCalled(); |
| 684 | +}); |
| 685 | + |
| 686 | +it("rejects unowned command roots even when --version is appended", async () => { |
| 687 | +await expect(runCli(["node", "openclaw", "foo", "--version"])).rejects.toThrow( |
| 688 | +'No built-in command or plugin CLI metadata owns "foo"', |
| 689 | +); |
| 690 | + |
| 691 | +expect(startProxyMock).not.toHaveBeenCalled(); |
| 692 | +expect(tryRouteCliMock).not.toHaveBeenCalled(); |
| 693 | +}); |
| 694 | + |
675 | 695 | it("does not suggest plugins.allow for unknown command roots before proxy startup", async () => { |
676 | 696 | loadConfigMock.mockReturnValueOnce({ |
677 | 697 | plugins: { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。