File tree 1 file changed +6
-5
lines changed 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1557,13 +1557,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1557
1557
}
1558
1558
}
1559
1559
1560
- // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
1561
1560
if ( maybeOption ( arg ) ) {
1561
+ // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
1562
1562
dest = unknown ;
1563
- }
1564
-
1565
- // If using passThroughOptions, stop processing options at first command-argument / unknown option.
1566
- if ( this . _passThroughOptions ) {
1563
+ } else if ( this . _passThroughOptions ) {
1564
+ // If using passThroughOptions, stop processing options at first command-argument.
1565
+ // Do not stop at unknown option
1566
+ // - so that known options after it and before a subcommand / command-argument are consumed by the parent command (including the help option);
1567
+ // - and because that is simply not what passThroughOptions is supposed to do.
1567
1568
dest . push ( arg , ...args ) ;
1568
1569
break ;
1569
1570
}
You can’t perform that action at this time.
0 commit comments