File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1557,13 +1557,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
15571557 }
15581558 }
15591559
1560- // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
15611560 if ( maybeOption ( arg ) ) {
1561+ // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
15621562 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.
15671568 dest . push ( arg , ...args ) ;
15681569 break ;
15691570 }
You can’t perform that action at this time.
0 commit comments