MCPcopy
hub / github.com/tj/commander.js / _findCommand

Method _findCommand

lib/command.js:1661–1666  ·  view source on GitHub ↗

* Find matching command. * * @private * @return {Command | undefined}

(name)

Source from the content-addressed store, hash-verified

1659 * @return {Command | undefined}
1660 */
1661 _findCommand(name) {
1662 if (!name) return undefined;
1663 return this.commands.find(
1664 (cmd) => cmd._name === name || cmd._aliases.includes(name),
1665 );
1666 }
1667
1668 /**
1669 * Return an option matching `arg` if any.

Callers 8

_getHelpCommandMethod · 0.95
_registerCommandMethod · 0.95
_dispatchSubcommandMethod · 0.95
_dispatchHelpCommandMethod · 0.95
_parseCommandMethod · 0.95
parseOptionsMethod · 0.95
aliasMethod · 0.80
getSuggestionFunction · 0.80

Calls

no outgoing calls

Tested by 1

getSuggestionFunction · 0.64