-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixed an issue with clibuilder not honoring the type flag GROOVY-9886 #1467
base: master
Are you sure you want to change the base?
Conversation
This change might be okay but possibly not needed. This currently works:
CliBuilder doesn't use the type info capability offered by commons cli but instead performs its own conversion: |
Yea we probably do that if we don't need to access the type field, but currently we switch on the type info given by the option class. We're looking to move to pico cli in the future but currently this is breaking quite a lot of stuff. |
Do you have an example of where you'd use the type? In general, having code which relies on underlying implementation details is always harder to port compared to code which uses the published API. I don't know whether the following helps:
It illustrates how to get the type in a way the leaks some details of the CliBuilder implementation but not details from the underlying CLI library and should port unchanged across to picocli. |
I can't really show the actual code, but it looks something like this
based on the groovy 2 docs, it does seem to support this behavior although didn't explicitly encourage it. |
From that snippet, you are perhaps doing work you don't need to as most types are already handled. But if you really do need it, I would suggest using |
Ideally, if we're starting from scratch, we'll use that, but unfortunately the snippet can only run in groovy 3 and we're trying to migrate a lot of code written in groovy 2 to work with groovy 3. What's the solution that could work in both 2 and 3? |
The examples I showed earlier work in 2.5+ but not 2.4. I don't know if that helps. |
yea we're still on 2.4, 2.5 has it's own fair share of issues :-| |
Interesting, if I switch to use the following doesn't seem to work
|
For the deprecated
And that class ( |
No description provided.