-
Notifications
You must be signed in to change notification settings - Fork 105
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
Respect autocomplete setting when parsing subcommands #288
Respect autocomplete setting when parsing subcommands #288
Conversation
In strict mode with autocomplete = false, the expectation is an error when validating the parent command's arguments In loose mode with autocomplete = false, the expectation is that the parent command gets executed
This fixes the failing specs from the previous commit
Nice catch on the strict arg handling. Your overall approach looks good. |
Thanks! This is ready for review then 😄 |
OK, cool. A couple of questions just to make sure I'm following it:
|
Correct.
I just checked again and it does fix the issue. I'll post a branch in the reproduction repo I linked in #287 Edit: I clicked the button before typing my answer to your second question😅 |
Here is an example when using the patched version: https://github.com/Root-App/gli-auto-complete/tree/verify-fix. I've updated the README to include how the output changes with the patch |
OK, awesome. I will merge and release here in a few… |
Released just now as 2.18.1 Thanks again for the fix! |
No problem! Thank you for maintaining this great gem |
In response to #287
The first commit adds tests to demonstrate what (I think) the expected behavior should be:
error: Too many arguments for command
I'm starting the PR as a draft because I'm not 100% sure if I'm correctly stating the expected behavior.
The next commit fixes the issue and makes the tests pass 🚀