-
Notifications
You must be signed in to change notification settings - Fork 423
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
requiredOptionMarker displayed on ArgGroup when it should not #1380
Comments
Interesting, that certainly looks like a bug. |
I could probably fix a pull req for this, but I'm wondering whether there's a corner case that I could have missed here. Or should the option of 'required' or not come completely from some other place than the ArgGroup annotation? |
Sorry, I don't understand the question. I expected the usage help message to look like this:
So, no |
Yes I expect the same behavior in this case! Just pondering if there's some other case where there's some logic needed to deduce if one or more options should show as being required. But I would assume such logic is solved using the @option or @parameter annotation information instead. |
Yes, the If you’d be interested in providing a Pr that’d be great! |
So I started digging through the code and found on line 10098 in the
Which I guess is correct, as neither of them is actually required so the hard brackets should be included? However, it wasn't that straightforward to set up the project in Eclipse so I cannot run any test suites or verify that this doesn't break anything else (which isn't really included in the contributing info anyways). Do you have any pointers on how to easily set up the project to run tests etc in an efficient way? |
Hm I have not used Eclipse in a while. You can run However, there is a reason that we made options required in exclusive groups. I believe here is the relevant ticket: #871 |
Thanks for giving some hints on how to run the tests, makes it much easier to contribute! And yeah, never thought of using the groups to handle lists of exclusive options, that's why I asked if there might be some case of which I haven't yet considered and thus might break something when solving my issue. My case seems much more trivial than the #871 ticket, and the validation seems to work in my case. Only the rendering of the usage text is the issue here. Not sure if I can contribute more to this, would require quite a bit of time. |
[#1380] Fix for requiredOptionMarker displayed on ArgGroup
When having a ArgGroup with multiplicity
0..1
, the usage shows options as required, but they should not. Here's an example code (I'm running picocli version 4.6.1):The output is this:
The text was updated successfully, but these errors were encountered: