-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passThroughOptions
being a superset of enablePositionalOptions
#1947
Comments
In normal use, The two concepts are separate. |
I see, but there is still a functionality overlap that makes the error unnecessary when the parent command uses
Not only in leaf commands, but also in commands that have both subcommands and an action handler attached, so the use in parent commands is justified. And when it is used in a parent command, it additionally has the effect of |
I understand the error may not be strictly required. I'll take another look, but it is currently as I intended. |
Here is my mental model for how options should be handled ideally given different settings in which there is no functional overlap between settings, and including the modified semantics for The change suggested by this issue is in bold. Default behavior:Consume all known options. Pass unknown options on for reprocessing by pushing to When using
|
I am still happy with the behaviour. Morally, perhaps the code could check Line 1522 in 4ef19fa
|
In absence of other issues coming up, I don't currently want to change the behaviour. Thank you for your contributions. |
Running this code results in the following error:
But actually, using
passThroughOptions
on a subcommand whose parent also uses it should be okay becausepassThroughOptions
makes options positional just likeenablePositionalOptions
. That is demonstrated by the following snippetand explained by the fact
passThroughOptions
is included in the check inlib/command.js
, line 1522.So is there any point in requiring
enablePositionalOptions
whenpassThroughOptions
which too has the needed effect is already on?My suggestion is
passThroughOptions
,passThroughOptions
so that there is no functionality overlap withenablePositionalOptions
.The latter idea introduces a breaking change but could be justified by some absurd use cases like
The text was updated successfully, but these errors were encountered: