-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Cannot use the same @Options name for command and SubCommand #663
Comments
Looks like this is a feature of how
|
👀 - Commenting to follow. Scott |
While reading the answers on the issue you created on commander repo I was thinking:
|
Sorry for the delay on getting back to this! Been a very busy month!
Yes, but it is an option we have to set across the entire commander instance, which could lead to some unexpected side effects of stricter options parsing. We'd probably want to make this an option that is passed via
I haven't looked into this yet. Let me get back to you on it. I could see it being useful. Something I might be able to do is add a new options for Actually, looks like yes it should be possible. I'll double check my implementation and see if the values are getting passed as expected. Okay, looks like something I'll need to add implementation for. Would be possible though. I could probably get both of these added in a PR by EOY if they sound like something that would be useful for the library |
Is there an existing issue for this?
Current behavior
The issue manifest while trying to reach the SubCommand of a Command.
If both have the same @option name like
--message
then the SubCommand will never get the option in its code.Is it a wanted behavior ?
Minimum reproduction code
The main command:
The SubCommand:
Expected behavior
expected output:
You really want me to say that: <CONTENT_OF_MESSAGE> ?
wrote in Yellow.real output:
You really want me to say that: undefined ?
wrote in YellowPackage
nest-commander
nest-commander-schematics
nest-commander-testing
Package version
3.3.0
Node.js version
18.8.0
In which operating systems have you tested?
Other
exemple repository for you to reproduce: https://github.com/jubeal/nestBugExemple
The text was updated successfully, but these errors were encountered: