Add support for executable subcommands with help flags differing from those of the parent command #1957
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disclaimer: The change introduced here is of low importance.
This PR builds upon the already approved #1930.
Diff only for the change introduced by this PR:
aweebit/commander.js@feature/fixes...feature/help-command-executable-help-flags
Problem
Currently, help commands don't have support for executable subcommands whose help flags differ from those of the parent command.
Such support could be useful especially when third-party executables are used.
Solution
Get help flags to pass to an executable subcommand from the subcommand instance rather than the parent instance in
._dispatchHelpCommand()
.Make it possible to set custom flags for such a subcommand instance by including
helpFlags
in the options passed to.command()
.node program help executable
ChangeLog
Added
helpFlags
option when calling.command()
)