fix(cli): correct --verbose / -v option syntax in acp commands (#21303)
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 20d058dcf524765f53681b601f605b0d4b3129f3 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:
@@ -2,6 +2,7 @@ import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { isRich, theme } from "../../terminal/theme.js";
|
||||
import { escapeRegExp } from "../../utils.js";
|
||||
import { hasFlag, hasRootVersionAlias } from "../argv.js";
|
||||
import { formatCliBannerLine, hasEmittedCliBanner } from "../banner.js";
|
||||
import { replaceCliName, resolveCliName } from "../cli-name.js";
|
||||
import { getCoreCliCommandsWithSubcommands } from "./command-registry.js";
|
||||
@@ -98,9 +99,9 @@ export function configureProgramHelp(program: Command, ctx: ProgramContext) {
|
||||
});
|
||||
|
||||
if (
|
||||
process.argv.includes("-V") ||
|
||||
process.argv.includes("--version") ||
|
||||
process.argv.includes("-v")
|
||||
hasFlag(process.argv, "-V") ||
|
||||
hasFlag(process.argv, "--version") ||
|
||||
hasRootVersionAlias(process.argv)
|
||||
) {
|
||||
console.log(ctx.programVersion);
|
||||
process.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user