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
feat(deps): introduce yargs-parser with support for unknown-options-as-args #1440
Conversation
Excellent work! |
I'm still seeing the custom command behaviour here yargs/yargs-parser#181 (comment). Is that expected with the new option? Ref ember-cli/ember-cli-update#688. |
@kellyselden: my change wasn't related to the extra value in the As an example, if you have the command definition |
@henderea @mleguen can you speak to @kellyselden's issue? @kellyselden what would need to change to support ember's use case? perhaps you can summarize this in another issue, and we can try to make sure we support your use case. |
I can always do |
@kellyselden 👍, I'm currently buried in other issues, but will make an effort to take a look at your use-case soon (see if the behavior was intended or not). |
@kellyselden I do not know if this was intentional - I have not been in this project for long -, but the code definitely looks like it was. This is definitely undocumented :-) However, it is useful when you read the parsing results outside of a command handler, as you can know the path of the executed command. The example for reset (although deprecated) in the doc uses this. As you stated yourself, I would recommend using slice in command handlers when you need to get only the remaining positionals. |
@mleguen @kellyselden I believe we originally didn't populate the command path, and people were concerned that they didn't have any way to determine context if they were using the same middleware for multiple commands. |
Cool stuff:
where the So ya, works great on 14.2.0! Thanks for getting this merged in and released. I think the way |
introduces unknown-options-as-args feature, which allows unknown options to be treated as arguments (either being collected inside of
_
, or passed as values to proceeding options).CC: @henderea, @mleguen, @kellyselden