Skip to content
Myr

Use getCommandAndParents for array of parents (#1566)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by John Gee · committed by GitHub · parent 56c4108 · Browse files · 1 file+2 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−9 removed

  • other:+2 added−9 removed

1 file+2 added−9 removed

modified:lib/command.js+2 added-9 removed
1660 unmodified lines
1661 contextOptions = undefined;1662 }1663 const context = this._getHelpContext(contextOptions);16641665 const groupListeners = [];1666 let command = this;1667 while (command) {1668 groupListeners.push(command); // ordered from current command to root1669 command = command.parent;1670 }16711672 groupListeners.slice().reverse().forEach(command => command.emit('beforeAllHelp', context));1665 getCommandAndParents(this).reverse().forEach(command => command.emit('beforeAllHelp', context));1666 this.emit('beforeHelp', context);16671668 let helpInformation = this.helpInformation(context);1669 if (deprecatedCallback) {
5 unmodified lines
1675 context.write(helpInformation);16761677 this.emit(this._helpLongFlag); // deprecated1678 this.emit('afterHelp', context);1686 groupListeners.forEach(command => command.emit('afterAllHelp', context));1679 getCommandAndParents(this).forEach(command => command.emit('afterAllHelp', context));1680 };16811682 /**1683 * You can pass in flags and a description to override the help
153 unmodified lines