rvesse / airline

Java annotation-based framework for parsing Git like command line structures with deep extensibility
https://rvesse.github.io/airline/
Apache License 2.0
128 stars 20 forks source link

Added test case for mutually exclusive options. Fixed thrown exception #66

Closed GTarkin closed 7 years ago

GTarkin commented 7 years ago

Hello there, a great library you have :+1:

Now to the issue: I noticed that when you annotate two options to be mutual exclusive, there, correctly, is an exception thrown if both of the options are set. However, the thrown exception is missing entries for the offending options, both in the message and in the Set of OptionMetadata contained within the exception. I think there might be a wrong filter applied when setting up the exception.

I wrote two testcases for this, and fixed it as best as my limited time at work and knowledge allowed. Maybe some stuff has to be moved and maybe the fix falls short for some other cases. Please have a look into it.

Hoping for further suggestions, GTarkin

rvesse commented 7 years ago

Thanks for the contribution

I have used your fix and tests as a basis for a slightly different fix as yours did not show options in that group that the user did not specify which may be valuable to show users.

I have pushed out a 2.4.0-SNAPSHOT with the fix so please test that and verify it resolves the issue in your real environment

GTarkin commented 7 years ago

Ok, will happly try. Where have you pushed the snapshot?

rvesse commented 7 years ago

Snapshots are published to OSSRH, see http://central.sonatype.org/pages/ossrh-guide.html#ossrh-usage-notes for how to use that repository

GTarkin commented 7 years ago

That fixes the problem. Thanks! :+1:

rvesse commented 7 years ago

No problem, thanks again for spotting the problem and providing a fix