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'
This commit is contained in:
ZTatman 2026-04-12 18:28:32 -04:00
parent 55d45adec8
commit 134d5ff8c7

View file

@ -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;
}