Apache Commons CLI Release Notes Fix broken Introduction links on the website #417. Fix malformed Javadoc comments. Correct HelpFormatter Javadoc #418. Bump org.apache.commons:commons-parent from 91 to 100 #414, #416. [test] Bump org.apache.commons:commons-text from 1.14.0 to 1.15.0. Bump commons-io:commons-io from 2.21.0 to 2.22.0. Multiple trailing BREAK_CHAR_SET characters cause infinite loop in HelpFormatter. Fix issue with groups not being reported in help output. #411. Add CommandLine.getOptionCount() to measure option repetition #396. Bump org.apache.commons:commons-parent from 85 to 91 #393. Bump commons-io:commons-io from 2.20.0 to 2.21.0. Deprecate CommandLine.Builder() in favor of CommandLine.builder(). Deprecate DeprecatedAttributes.Builder() in favor of DeprecatedAttributes.builder(). Refactor default parser test #294. Port to JUnit 5. Generics for Converter should use Exception not Throwable. Pick up maven-antrun-plugin version from parent POM org.apache:apache. Javadoc is missing its Overview page. Get mockito version from parent pom (#351). Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80). Deprecate PatternOptionBuilder.PatternOptionBuilder(). HelpFormatter infinite loop with 0 width input. Fail faster with a more precise NullPointerException: Option.processValue() throws NullPointerException when passed null value with value separator configured. Fail faster with a more precise NullPointerException: DefaultParser.parse() throws NullPointerException when options parameter is null. Options.addOptionGroup(OptionGroup) does not remove required options from requiredOpts list. org.apache.commons.cli.Option.Builder.get() should throw IllegalStateException instead of IllegalArgumentException. org.apache.commons.cli.Option.processValue(String) should throw IllegalStateException instead of IllegalArgumentException. org.apache.commons.cli.OptionBuilder.create() should throw IllegalStateException instead of IllegalArgumentException. Help formatter extension in the new package #314. CommandLine.Builder implements Supplier<CommandLine>. DefaultParser.Builder implements Supplier<DefaultParser>. Add CommandLine.getParsedOptionValues() #334. org.apache.commons.cli.Option.Builder implements Supplier<Option>. Add new options for parsing: ignore and skip. Bump org.apache.commons:commons-parent from 72 to 85 #302, #304, #310, #315, #320, #327, #371. [test] Bump commons-io:commons-io from 2.16.1 to 2.20.0 #309, #337. [test] Bump org.apache.commons:commons-text from 1.12.0 to 1.14.0 #344. Update site documentation to https://maven.apache.org/xsd/xdoc-2.0.xsd. Add OptionGroup.isSelected(). You can now extend HelpFormatter.Builder. Add 'since' attribute to Option to track when an Option was introduced #292 Fix Javadoc pathing #280. Updated properties documentation #285. Deprecation not always reported #284. Replace internal StringBuffer with StringBuilder. Bump org.apache.commons:commons-parent from 70 to 72 #283. Add optional HelpFormatter Function to document Deprecated options #271. Add PMD check to default Maven goal. Handle reporting of deprecated options when parameters are not String type. #270. Avoid throwing NullPointerException when calling CommandLineParser will null array elements. Cleanup deprecation issues #272. Fix PMD UnnecessaryFullyQualifiedName issues. Bump commons-parent from 69 to 70. Inconsistent behavior in key/value pairs (Java property style). Avoid NullPointerException in Util.stripLeadingAndTrailingQuotes(String). Awkward behavior of Option.builder() for multiple optional args. Properties from multiple arguments with value separator. #237. Fix for expected textual date values. #244. Option.Builder.option("") should throw IllegalArgumentException instead of ArrayIndexOutOfBoundsException. Avoid NullPointerException in CommandLine.getOptionValues(Option|String). Add and use a Converter interface and implementations without using BeanUtils #216. Add Maven property project.build.outputTimestamp for build reproducibility. Add '-' as an option char and implemented extensive tests #217. Make adding OptionGroups and Options to existing Options easier #230. Added Supplier<T> defaults for getParsedOptionValue #229. Make Option.getKey() public #239. Add builder factory CommandLine#builder(). Support "Deprecated" CLI Options #252. Bump commons-parent from 64 to 69 #256. Update the tests to JUnit 5 #238. Bump tests commons-io:commons-io from 2.16.0 to 2.16.1 #258. Fix SpotBugs Error: Medium: Method intentionally throws RuntimeException. [org.apache.commons.cli.Option] At Option.java:[lines 417-423] THROWS_METHOD_THROWS_RUNTIMEEXCEPTION Fix SpotBugs Error: Medium: Method intentionally throws RuntimeException. [org.apache.commons.cli.Option] At Option.java:[lines 446-450] THROWS_METHOD_THROWS_RUNTIMEEXCEPTION Fix SpotBugs Error: Medium: Method intentionally throws RuntimeException. [org.apache.commons.cli.Option] At Option.java:[lines 474-478] THROWS_METHOD_THROWS_RUNTIMEEXCEPTION Use EMPTY_STRING_ARRAY constant. #102. Fix site links that are broken #155. Use Math.max() #111. Delete unused assignment #112. [StepSecurity] ci: Harden GitHub Actions #176. Inconsistent date format in changes report. Fix NPE in CommandLine.resolveOption(String). CommandLine.addOption(Option) should not allow a null Option. CommandLine.addArgs(String) should not allow a null String. Site docs: "Usage Scenarios" refers to deprecated methods. NullPointerException thrown by CommandLineParser.parse(). StringIndexOutOfBoundsException thrown by CommandLineParser.parse(). Add github/codeql-action. Bump Java from 7 to 8. Bump actions/cache from 2.1.7 to 3.0.10 #97, #130, #132. Bump actions/checkout from 3 to 3.1.0 #133. Bump actions/setup-java from 2 to 3.6.0 #136. Bump spotbugs from 4.5.3 to 4.7.3 #96, #107, #113, #125, #138. Bump spotbugs-maven-plugin from 4.5.3.0 to 4.7.3.0 #98, #108, #115, #117, #126, #145. Bump commons-parent from 52 to 64 #100, #128, #151, #158. Bump maven-antrun-plugin from 3.0.0 to 3.1.0 #103. Bump maven-javadoc-plugin from 3.3.2 to 3.4.1 #105, #120. Bump maven-pmd-plugin from 3.16.0 to 3.19.0 #110, #124. Bump jacoco-maven-plugin from 0.8.7 to 0.8.8. Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 #121. Bump japicmp-maven-plugin from 0.15.4 to 0.16.0. Update JUnit 4 to 5 vintage. Fix NPE in DefaultParser.isLongOption(String). @param or @return lines should end with a period in CommandLine.java Replace deprecated FindBugs with SpotBugs. Replace CLIRR with JApiCmp. Option Javadocs grammar nits #55. Minor Improvements #57, #61. Input "test" gets parsed as test, quotes die #58. Allow whitespace-only header and footer #26. Accommodate toggling partial matching in DefaultParser. Option parser type EXISTING_FILE_VALUE not check file existing CommandLine.getXXX and CommandLine.hasXXX should accept an Option as a parameter Adjust access-modifier of checkRequiredOptions() to protected. TypeHandler should throw ParseException for an unsupported class. Added setter for Builder.option #33. Add Option unit tests #76. Update Java from version 5 to 7. Docs: Replace OptionBuilder in usage page #30. Remove deprecated sudo setting. #36. Bump junit:junit from 4.12 to 4.13.2, #53, #60. Bump commons-parent from 48 to 52. Bump maven-pmd-plugin from 3.12.0 to 3.16.0, #44, #54, #67, #92. Bump actions/checkout from 2.3.1 to 3 #46, #72, #78, #93. Bump actions/setup-java from v1.4.2 to v2 #50. Bump maven-antrun-plugin from 1.7 to 3.0.0 #43. Bump maven-checkstyle-plugin from 2.15 to 3.1.2 #41. Bump checkstyle to 9.3 #68, #86, #90. Bump actions/cache from 2 to 2.1.7 #64, #65, #81. Bump commons.animal-sniffer.version 1.19 -> 1.20. Bump maven-bundle-plugin 5.1.1 -> 5.1.2. Bump biz.aQute.bndlib.version 5.1.2 -> 6.0.0. Bump spotbugs from 4.4.1 to 4.5.3 #70, #88. Bump spotbugs-maven-plugin from 4.4.1 to 4.5.3.0 #71, #85, #87. Bump maven-javadoc-plugin from 3.3.1 to 3.3.2, #91. Introduce CommandLine.Builder Optional argument picking up next regular option as its argument Add an addRequiredOption method to Options HelpFormatter.setOptionComparator(null) doesn't display the values in inserted order LongOpt falsely detected as ambiguous Fixed broken Javadoc links on Introduction page. Fixed code example in javadoc of "Option#Builder#valueSeparator(char)". Clarified behavior of "OptionValidator#validateOption(String)" in case of null input. Small cleanup of Option class. Removed DoubleCheckedLocking test from checkstyle configuration. Options.getRequiredOptions() now returns an unmodifiable list. Added new fluent API to create Option instances via builder class Option.Builder. This replaces the now deprecated OptionBuilder. Clarify javadoc for CommandLine.getOptionValue() that the first specified argument will be returned. Added new method Options.addOption(String, String). Changed unit tests to junit 4 annotation style. Default options will now work correctly with required options that are missing. Default options will now work correctly together with option groups. The javadoc of OptionBuilder now states that the class is not thread-safe. HelpFormatter now supports setting the displayed separator of long options. Improve description of parameter "stopAtNonOption" in method CommandLine.parse(Options, String[], boolean). Passing default values for not defined options to a parser will now trigger a ParseException instead of a NullPointerException. HelpFormatter.setArgName(String) now correctly sets the argument name. Default properties provided as input to the Parser.parse() methods are now correctly processed. CommandLine.getParsedOptionValue() now returns a String object if no option type has been explicitly set. Fixed typo in javadoc of class CommandLine. Source code now uses generic types instead of raw types where possible. Corrected javadoc for return type of MissingOptionException.getMissingOptions(). HelpFormatter now prints command-line options in the same order as they have been added. Standard help text now shows mandatory arguments also for the first option. HelpFormatter does not strip anymore leading whitespace in the footer text. Strip quotes contained in argument values only if there is exactly one at the beginning and one at the end. Negative numerical arguments take precedence over numerical options (only supported by the new DefaultParser). Fix possible StringIndexOutOfBoundsException in HelpFormatter. A new parser is available: DefaultParser. It combines the features of the GnuParser and the PosixParser. It also provides additional features like partial matching for the long options, and long options without separator (i.e like the JVM memory settings: -Xmx512m). This new parser deprecates the previous ones. OptionGroups no longer throw an AlreadySelectedException when reused for several parsings. OptionGroup now selects properly an option with no short name. PosixParser now supports partial long options (--ver instead of --version). OptionBuilder is now reseted if an IllegalArgumentException occurs in create(). Ant build system removed. Incomplete usage documentation about Java property option. TypeHandler prints messages to stderr. Infinite loop in the wrapping code of HelpFormatter. Fixing some minor javadoc issues. The number of arguments defined for an option specifies the arguments per occurrence of the option and not for all occurrences. This was a major regression in CLI 1.1 which prevented the use of repeated options. Added a getOptionProperties() method in the CommandLine class to retrieve easily the key/value pairs specified with options like -Dkey1=value1 -Dkey2=value2. GnuParser now supports long options with an '=' sign (ie. --foo=bar and -foo=bar) PosixParser no longer ignores unrecognized short options. PosixParser no longer stops the bursting process of a token if stopAtNonOption is enabled and a non option character is encountered. PosixParser no longer keeps processing the tokens after an unrecognized long option when stopAtNonOption is enabled. Required options are properly checked if an Options instance is used twice to parse a command line. The ordering of options can be defined in help messages. The line wrapping in HelpFormatter now works properly. This caused CLI-162, and thus there was a feature change for the HelpFormatter in that it is strict on width now rather than what seemed to be lenience before. Text without whitespace will be cut off to fit in the spacing, and an IllegalStateException will be thrown if it is impossible to output the information due to spacing constraints. The message of MissingOptionException has been improved. The exceptions have been enhanced with methods to retrieve easily the related options. Option.toString() now reports arguments properly. The Parser class has been changed to be more easily extendable. The following classes are now serializable: Option, OptionGroup, CommandLine and Options. OptionValidator is no longer public, its methods were all private. Wrong usage summary. Dependecy on commons-lang-2.0 but commons-lang-1.0 is obtained. Line separator as first char for helpformatter (footer) throws exception. CommandLine.getOptionValue() behaves contrary to docs. clone method in Option should use super.clone(). Passing properties in Parser does not work for options with a single argument. Only long options without short option seems to be noticed. Infinite Loop in Command-Line processing. Options should not be able to be added more than once. HelpFormatter doesn't sort options properly. HelpFormatter doesn't function correctly for options with only LongOpt. Document enhancement. Documentation errors. Parameter value "-something" misinterpreted as a parameter. clone() method doesn't fully clone contents. No Javadoc for HelpFormatter!. Parser breaks up command line parms into single characters. Missing arguments in HelpFormatter.renderOptions(..). Error parsing option arguments. A weakness of parser. Setting description of a Option. CLI_1_BRANCH build.xml doesn't work. Remove the Commons Lang dependency. Options class returns options in random order. MissingOptionException should contain a useful error message. NullPointerException in Util.stripLeadingHyphens when passed a null argument. 1.1 is not backwards compatible because it adds methods to the CommandLineParser interface. Backwards compatibility between 1.1 and 1.0 broken due to Option.addValue removal.