File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ class Command extends EventEmitter {
272
272
273
273
this . commands . push ( cmd ) ;
274
274
cmd . parent = this ;
275
- this . _checkForBrokenPassThrough ( cmd , this ) ;
275
+ cmd . _checkForBrokenPassThrough ( ) ;
276
276
277
277
return this ;
278
278
}
@@ -737,19 +737,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
737
737
*/
738
738
passThroughOptions ( passThrough = true ) {
739
739
this . _passThroughOptions = ! ! passThrough ;
740
- this . _checkForBrokenPassThrough ( this , this . parent ) ;
740
+ this . _checkForBrokenPassThrough ( ) ;
741
741
return this ;
742
742
}
743
743
744
744
/**
745
- * @param {Command } command
746
- * @param {Command | null } parent
747
745
* @api private
748
746
*/
749
747
750
- _checkForBrokenPassThrough ( command , parent ) {
751
- if ( parent && command . _passThroughOptions && ! parent . _enablePositionalOptions ) {
752
- throw new Error ( `passThroughOptions cannot be used for '${ command . _name } ' without turning on enablePositionalOptions for parent command(s)` ) ;
748
+ _checkForBrokenPassThrough ( ) {
749
+ if ( this . parent && this . _passThroughOptions && ! this . parent . _enablePositionalOptions ) {
750
+ throw new Error ( `passThroughOptions cannot be used for '${ this . _name } ' without turning on enablePositionalOptions for parent command(s)` ) ;
753
751
}
754
752
}
755
753
You can’t perform that action at this time.
0 commit comments