From 134d5ff8c71626bb07084dad1dfea92baebeab2c Mon Sep 17 00:00:00 2001 From: ZTatman Date: Sun, 12 Apr 2026 18:28:32 -0400 Subject: [PATCH] fix(cli): handle help flag as subcommand parameter more explicitly - Convert help flags to undefined before passing to showCommandHelp - Improves semantic clarity when user runs 'myst config --help' --- packages/cli/src/cli-router.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/cli-router.ts b/packages/cli/src/cli-router.ts index 7cdb03b..d00e4ea 100644 --- a/packages/cli/src/cli-router.ts +++ b/packages/cli/src/cli-router.ts @@ -185,7 +185,9 @@ export async function runCli( // If help is requested for a specific command, show command-specific help if (wantsCommandHelp) { - showCommandHelp(command, cmdConf, subcommand || undefined); + const isHelpFlag = (arg: string) => arg === "--help" || arg === "-h"; + const actualSubcommand = isHelpFlag(subcommand) ? undefined : subcommand; + showCommandHelp(command, cmdConf, actualSubcommand); return; }