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

Add new @NoOptionLikeValues restriction annotation #113

Closed rvesse closed 2 years ago

rvesse commented 2 years ago

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.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 594


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 Coverage Status
Change from base Build 585: 0.1%
Covered Lines: 5635
Relevant Lines: 7837

💛 - Coveralls