-
Notifications
You must be signed in to change notification settings - Fork 414
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
Issue with map fields when clustered short options are disallowed #488
Comments
Hi, yes, this is the expected behaviour (also in the current latest version 3.6.0). POSIX allows an option parameter value attached to the last option in a cluster ( This seemed natural to me but we can change this or add a new parser configuration switch. |
@MaryamZi Are you okay with the current behaviour or do you need this to behave differently? |
As a side-note, it may be good to have this question on StackOverflow to build a knowledge base for other picocli users. Would you be okay with moving this conversation to StackOverflow? |
I went ahead and posted this question on StackOverflow. |
@remkop sorry about the delay in responding. The current behaviour is OK, just wanted to clarify if this was the expected behaviour. Should we maybe include this in the documentation too, since all possible ways of specification are mentioned in the example? Thank you! |
@MaryamZi No worries, glad to hear the current behaviour is ok. Good idea to clarify the docs. I will add a note to the https://picocli.info/#_posix_clustered_short_options section. |
Description
When clustered short options are disallowed with
CommandLine.setPosixClusteredShortOptionsAllowed(false)
specifying arguments for map fields as follows
-Pmyprop=myvalue
fails with the exception
picocli.CommandLine$UnmatchedArgumentException: Unknown option: -Pmyprop=myvalue
The space is now required between
-P
and the key-value pair.-P myprop=myvalue //works
Is this the expected behaviour? IMO, map fields are different from other fields, and it would be useful to have the support for the former even when clustered short options are not allowed.
Version
3.3.0
The text was updated successfully, but these errors were encountered: