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

Method parseAsync

lib/command.js:1110–1116  ·  view source on GitHub ↗

* Parse `argv`, setting options and invoking commands when defined. * * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode! * * Or call with an array of strings to parse, and optionally where the user arguments start b

(argv, parseOptions)

Source from the content-addressed store, hash-verified

1108 */
1109
1110 async parseAsync(argv, parseOptions) {
1111 this._prepareForParse();
1112 const userArgs = this._prepareUserArgs(argv, parseOptions);
1113 await this._parseCommand([], userArgs);
1114
1115 return this;
1116 }
1117
1118 _prepareForParse() {
1119 // Save the state the first time, then restore the state before each subsequent parse.

Callers 5

hook.jsFile · 0.80
index.test-d.tsFile · 0.80

Calls 3

_prepareForParseMethod · 0.95
_prepareUserArgsMethod · 0.95
_parseCommandMethod · 0.95

Tested by

no test coverage detected