fix(cli): correct --verbose / -v option syntax in acp commands (#21303)

Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 20d058dcf5
Co-authored-by: adhitShet <131381638+adhitShet@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
adhitShet
2026-02-20 06:04:22 +04:00
committed by GitHub
parent 9264a8e21a
commit 164d478652
8 changed files with 120 additions and 8 deletions

View File

@@ -44,10 +44,12 @@ describe("shouldRegisterPrimarySubcommand", () => {
it("skips eager primary registration for help/version invocations", () => {
expect(shouldRegisterPrimarySubcommand(["node", "openclaw", "status", "--help"])).toBe(false);
expect(shouldRegisterPrimarySubcommand(["node", "openclaw", "-V"])).toBe(false);
expect(shouldRegisterPrimarySubcommand(["node", "openclaw", "-v"])).toBe(false);
});
it("keeps eager primary registration for regular command runs", () => {
expect(shouldRegisterPrimarySubcommand(["node", "openclaw", "status"])).toBe(true);
expect(shouldRegisterPrimarySubcommand(["node", "openclaw", "acp", "-v"])).toBe(true);
});
});
@@ -107,6 +109,7 @@ describe("shouldEnsureCliPath", () => {
it("skips path bootstrap for help/version invocations", () => {
expect(shouldEnsureCliPath(["node", "openclaw", "--help"])).toBe(false);
expect(shouldEnsureCliPath(["node", "openclaw", "-V"])).toBe(false);
expect(shouldEnsureCliPath(["node", "openclaw", "-v"])).toBe(false);
});
it("skips path bootstrap for read-only fast paths", () => {
@@ -119,5 +122,6 @@ describe("shouldEnsureCliPath", () => {
it("keeps path bootstrap for mutating or unknown commands", () => {
expect(shouldEnsureCliPath(["node", "openclaw", "message", "send"])).toBe(true);
expect(shouldEnsureCliPath(["node", "openclaw", "voicecall", "status"])).toBe(true);
expect(shouldEnsureCliPath(["node", "openclaw", "acp", "-v"])).toBe(true);
});
});