Skip to content

Commit

Permalink
Improve comment on passThroughOptions
Browse files Browse the repository at this point in the history
Includes a partial fix for tj#1936 (docs need an update, too)
  • Loading branch information
aweebit committed Aug 5, 2023
1 parent d1fd350 commit b11e940
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
}
}

// If using passThroughOptions, stop processing options at first command-argument.
// If using passThroughOptions, stop processing options (except help) at first command-argument / unknown option.
// Processing after an unknown option is not possible because there is no way to know if the next argument is its option-argument and we should continue,
// or if it is a command-argument and we should stop.
if (this._passThroughOptions) {
onlyConsumeHelpOption = true;
if (!this._hasHelpOption || !maybeOption(arg)) {
Expand Down

0 comments on commit b11e940

Please sign in to comment.