(argv: string[])
| 42 | } |
| 43 | |
| 44 | function runHelpFastPath(argv: string[]): boolean { |
| 45 | const helpTarget = resolveSimpleHelpTarget(argv); |
| 46 | if (helpTarget === undefined) return false; |
| 47 | |
| 48 | import('./cli/parser/cli-help.ts') |
| 49 | .then(({ buildCommandUsageText, buildUsageText }) => { |
| 50 | if (helpTarget === null) { |
| 51 | process.stdout.write(`${buildUsageText()}\n`); |
| 52 | return; |
| 53 | } |
| 54 | const commandHelp = buildCommandUsageText(normalizeHelpTarget(helpTarget)); |
| 55 | if (commandHelp) { |
| 56 | process.stdout.write(commandHelp); |
| 57 | return; |
| 58 | } |
| 59 | // Unknown help topics still need full CLI parsing for the normal error path. |
| 60 | runCli(argv); |
| 61 | }) |
| 62 | .catch(handleStartupError); |
| 63 | return true; |
| 64 | } |
| 65 | |
| 66 | function resolveSimpleHelpTarget(argv: string[]): string | null | undefined { |
| 67 | switch (argv.length) { |
no test coverage detected