Closed rvesse closed 2 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
airline-core/src/main/java/com/github/rvesse/airline/restrictions/common/NoOptionLikeValuesRestriction.java | 22 | 26 | 84.62% | ||
<!-- | Total: | 29 | 33 | 87.88% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
airline-core/src/main/java/com/github/rvesse/airline/annotations/restrictions/PortType.java | 2 | 92.31% | ||
airline-core/src/main/java/com/github/rvesse/airline/restrictions/common/PortRangeImpl.java | 2 | 65.52% | ||
<!-- | Total: | 4 | --> |
Totals | |
---|---|
Change from base Build 585: | 0.1% |
Covered Lines: | 5635 |
Relevant Lines: | 7837 |
This handles the case where option-like values, whether intentional or typo'd by the user, that are passed to options/arguments should be rejected.
This is a solution to the issue described in #112.
Users can use the new
@NoOptionLikeValues
annotation to indicate that an@Option
/@Arguments
annotated field will reject any values that look like they are options BUT did not match a defined option. The set of prefixes used to consider a value being option like is configurable to deal with users who have unusual/non-standard option naming schemes.