-
Notifications
You must be signed in to change notification settings - Fork 446
Another implementation of case-insensitive support for subcommands and options (#9) #1021
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
Conversation
Since console commands and options should be in ascii characters, the case-insensitive only consider mapping of english characters.
|
I’ll do another check tomorrow. Can you think of tests for any edge cases introduced by this change? Like ambiguities that didn’t exist before? I can think of cases where the combination of POSIX options now resembles a long option, or a long option with the same name as a subcommand, it may be good to have tests for those. Can anyone think of other tests? |
|
Great, thank you! I think we are getting close. Codecov reports that code coverage will go down if this PR is merged. Can you add tests for the code changes that are not or only partially covered by the tests yet? |
|
Since LinkedCaseAwareMap is a private class (and probably should be), some code are not called by picocli (no any public method can reach these lines) and they are there for potential future error-checking. I could add some tests using reflection on the custom map, but does Codecov count that as 'coverage'? |
|
For example, uncovered lines are checks for non-convertible classes, null keys, removing elements, which are not called by any other picocli code. |
|
Now the coverage shall increase after this PR is merged! 😃 Edit: The Codecov report seems to be incorrectly comparing wrong commits? The diff coverage is |
|
That is great! Thank you very much. Do you think you will be able to add some documentation to the parser configuration section of the user manual (in the |
|
I am not a native English speaker and not really familiar with asciidoc 😅. It would probably be better if you could add those documentation. |
|
okay, no worries. |
I'm willing to help on writing documentation. Is |
|
Yes index.adoc is the main file for documentation. To test, run: Then check the generated HTML in build/docs/html5/index.html |
* update RELEASE-NOTES.md * simplify user manual section on Case Sensitivity * throw DuplicateNameException instead of IllegalStateException in CaseInsensitiveLinkedMap * throw DuplicateNameException instead of InitializationException in addSubcommand * suppress warnings for unchecked cast * minor improvements to POSIXOptionResembleDemo

This is an alternative PR to #1020 , follows a somewhat different approach, trying to solve #9 .
Currently it is only a draft, feedbacks are welcomed. Tests are partially added, not fully tested.
No previous tests are broken due to the new changes.