-
Notifications
You must be signed in to change notification settings - Fork 425
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
Use generic types in containers (e.g. List, Map) #1396
Comments
Hi @mgorniew, the logic in picocli for types only looks up to 2 levels: the first level is for containers like The logic for getting type information is in It may be quite tricky to change picocli to handle generic types; picocli's type model currently models types in a |
Simple idea here is to cut any additional generics information from aux types. So in case from my example this means that |
That works for multi-value options like:
Would it also work for single-value options like:
|
I didn't dig to much into code, but I've added tests (new commit) and it seems to work fine. Should I create PR? We could discuss details there. |
Okay please create a PR. (Note I have very little time to work on picocli recently, you may need to be patient.) |
Hi,
I would like to be able to parse arguments which will map to list for generic types, e.g.
This is now not possible. Is this limitation introduced to ensure better type safety? I've modified code to support such use case, but my solution sacrifices types safety by removing information about generic types:
mgorniew@6a6f773
Is such solution acceptable or this approach was considered before and rejected?
Thanks
Michał
The text was updated successfully, but these errors were encountered: