mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:51:46 +00:00
fix(cli): respect subcommand version options (#87398)
* fix(cli): respect subcommand version options * test: stabilize model directive auth status
This commit is contained in:
@@ -165,4 +165,22 @@ describe("configureProgramHelp", () => {
|
||||
resolveCommitHashMock.mockReturnValue(null);
|
||||
expectVersionExit({ expectedVersion: "OpenClaw 9.9.9-test" });
|
||||
});
|
||||
|
||||
it("does not treat subcommand --version options as root version requests", () => {
|
||||
process.argv = ["node", "openclaw", "skills", "verify", "discrawl", "--version", "1.0.0"];
|
||||
const logSpy = vi.spyOn(console, "log").mockImplementation(() => {});
|
||||
const exitSpy = vi.spyOn(process, "exit").mockImplementation(((code?: number) => {
|
||||
throw new Error(`exit:${code ?? ""}`);
|
||||
}) as typeof process.exit);
|
||||
|
||||
try {
|
||||
const program = makeProgramWithCommands();
|
||||
expect(() => configureProgramHelp(program, testProgramContext)).not.toThrow();
|
||||
expect(logSpy).not.toHaveBeenCalled();
|
||||
expect(exitSpy).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
logSpy.mockRestore();
|
||||
exitSpy.mockRestore();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user