-
Notifications
You must be signed in to change notification settings - Fork 422
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
PropertiesDefaultProvider fails with static ArgGroup class #876
Comments
Thank you for raising this! I’ll investigate when I get to my PC. |
I have only had a chance to look at this for a few minutes, but I’m guessing that this is related to the fact that default values in general are not applied to ArgGroups until at least one option in the group is matched. |
How can I reproduce this? If I make inner However, I believe the observed behaviour is the expected behaviour: picocli will not instantiate a I understand this may not be intuitive for many users but I cannot imagine how it could work otherwise. |
Sorry for not being clear here. I edited my inital posting to make it clear and unambigous. Hopefully I succeeded in doing so. |
Thanks for the clarification. Basically, if the application has instantiated the If the application has not instantiated the the |
Classname ArgGroupDefaultValueTest Description of issue: I understand that by default defaultValue in ArgGroup are not applied. The behavior is explained at : remkop#876 (comment) (Note: The default behavior seems surprising to me at first sight but maybe it's justified) I faced a situation where it seems that this behavior is not respected (but maybe I missed something) Sorry for the not so short example, I was not able to make it smaller. The goal is to have this kind of options : X AND ((1A AND 1B) OU (2A OU 2B)) I set default value for X, 2A and 2B.
@remkop This issue is also closed by PR 1446, correct? |
It is the same underlying mechanism, yes. ( Oh, I see what you mean now: can this issue be closed now that we improved the documentation? |
Minimum example:
Java source file:
Associated properties file (MyCommand.properties):
If you comment out line 29 and uncomment line 30, the value from the properties file is picked up.
Is this the intended behaviour?
The text was updated successfully, but these errors were encountered: