MCPcopy
hub / github.com/callstack/agent-device / runHelpFastPath

Function runHelpFastPath

src/bin.ts:44–64  ·  view source on GitHub ↗
(argv: string[])

Source from the content-addressed store, hash-verified

42}
43
44function 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
66function resolveSimpleHelpTarget(argv: string[]): string | null | undefined {
67 switch (argv.length) {

Callers 1

runFastPathFunction · 0.85

Calls 6

resolveSimpleHelpTargetFunction · 0.85
buildUsageTextFunction · 0.85
buildCommandUsageTextFunction · 0.85
normalizeHelpTargetFunction · 0.85
writeMethod · 0.80
runCliFunction · 0.70

Tested by

no test coverage detected