File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -1662,14 +1662,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1662
1662
}
1663
1663
const context = this . _getHelpContext ( contextOptions ) ;
1664
1664
1665
- const groupListeners = [ ] ;
1666
- let command = this ;
1667
- while ( command ) {
1668
- groupListeners . push ( command ) ; // ordered from current command to root
1669
- command = command . parent ;
1670
- }
1671
-
1672
- groupListeners . slice ( ) . reverse ( ) . forEach ( command => command . emit ( 'beforeAllHelp' , context ) ) ;
1665
+ getCommandAndParents ( this ) . reverse ( ) . forEach ( command => command . emit ( 'beforeAllHelp' , context ) ) ;
1673
1666
this . emit ( 'beforeHelp' , context ) ;
1674
1667
1675
1668
let helpInformation = this . helpInformation ( context ) ;
@@ -1683,7 +1676,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1683
1676
1684
1677
this . emit ( this . _helpLongFlag ) ; // deprecated
1685
1678
this . emit ( 'afterHelp' , context ) ;
1686
- groupListeners . forEach ( command => command . emit ( 'afterAllHelp' , context ) ) ;
1679
+ getCommandAndParents ( this ) . forEach ( command => command . emit ( 'afterAllHelp' , context ) ) ;
1687
1680
} ;
1688
1681
1689
1682
/**
You can’t perform that action at this time.
0 commit comments