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

@@ -29,6 +29,31 @@ describe("argv helpers", () => {
argv: ["node", "openclaw", "status"],
expected: false,
},
{
name: "root -v alias",
argv: ["node", "openclaw", "-v"],
expected: true,
},
{
name: "root -v alias with profile",
argv: ["node", "openclaw", "--profile", "work", "-v"],
expected: true,
},
{
name: "subcommand -v should not be treated as version",
argv: ["node", "openclaw", "acp", "-v"],
expected: false,
},
{
name: "root -v alias with equals profile",
argv: ["node", "openclaw", "--profile=work", "-v"],
expected: true,
},
{
name: "subcommand path after global root flags should not be treated as version",
argv: ["node", "openclaw", "--dev", "skills", "list", "-v"],
expected: false,
},
])("detects help/version flags: $name", ({ argv, expected }) => {
expect(hasHelpOrVersion(argv)).toBe(expected);
});