Prepare for a release candidate.
diff --git a/README.md b/README.md
index 94c78c6..36e975d 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@
[![GitHub Actions Status](https://github.com/apache/commons-cli/workflows/Java%20CI/badge.svg)](https://github.com/apache/commons-cli/actions)
[![Coverage Status](https://coveralls.io/repos/apache/commons-cli/badge.svg)](https://coveralls.io/r/apache/commons-cli)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/commons-cli/commons-cli/badge.svg)](https://maven-badges.herokuapp.com/maven-central/commons-cli/commons-cli/)
-[![Javadocs](https://javadoc.io/badge/commons-cli/commons-cli/1.5.svg)](https://javadoc.io/doc/commons-cli/commons-cli/1.5)
+[![Javadocs](https://javadoc.io/badge/commons-cli/commons-cli/1.5.0.svg)](https://javadoc.io/doc/commons-cli/commons-cli/1.5.0)
Apache Commons CLI provides a simple API for presenting, processing and validating a Command Line Interface.
@@ -68,7 +68,7 @@
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
- <version>1.5</version>
+ <version>1.5.0</version>
</dependency>
```
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 22809b3..ee4c826 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -1,251 +1,74 @@
- Apache Commons CLI
- Version 1.4
- Release Notes
+Apache Commons CLI
+Version 1.5.0-SNAPSHOT
+Release Notes
-INTRODUCTION:
+This document contains the release notes for this version of the Apache Commons
+CLI Component of the Apache Commons Project. Commons CLI provides a simple API
+for working with the command line arguments and options.
-This document contains the release notes for this version of the Commons CLI
-package. Commons CLI provides a simple API for working with the command line
-arguments and options.
+Apache Commons CLI provides a simple API for presenting, processing and validating a Command Line Interface.
-Commons CLI 1.4 is a feature release and binary compatible with the
-previous versions, except for the OptionValidator class that is no longer public
-(change introduced in v1.2). Commons CLI 1.4 at least requires Java 5.0.
+New features and bug fixes (Java 7).
-More information can be found on the project site at
-https://commons.apache.org/cli.
+Changes in this version include:
-
-NEW FEATURES
+New Features
============
-o CLI-269: Introduce CommandLine.Builder
-o CLI-267: Add an addRequiredOption method to Options.
- Thanks to Ricardo Ribeiro.
+o CLI-217: Accommodate toggling partial matching in DefaultParser. Thanks to Rubin Simons.
+o CLI-274: Option parser type EXISTING_FILE_VALUE not check file existing Thanks to Béla Schaum.
+o CLI-271: CommandLine.getXXX and CommandLine.hasXXX should accept an Option as a parameter Thanks to Christoph Läubrich.
+o CLI-276: Adjust access-modifier of checkRequiredOptions() to protected. Thanks to Jason Dillon.
+o CLI-282: TypeHandler should throw ParseException for an unsupported class. Thanks to Alex Nordlund.
+o Added setter for Builder.option #33. Thanks to Waldemar Sojka, Gary Gregory.
+o Add Option unit tests #76. Thanks to Waldemar Sojka, Gary Gregory.
+Fixed Bugs
+==========
-BUG FIXES
-=========
+o Fix NPE in DefaultParser.isLongOption(String). Thanks to Gary Gregory.
+o CLI-279: @param or @return lines should end with a period in CommandLine.java Thanks to Krishna Mohan Rao Kandunoori.
+o Replace deprecated FindBugs with SpotBugs. Thanks to Gary Gregory.
+o Replace CLIRR with JApiCmp. Thanks to Gary Gregory.
+o Option Javadocs grammar nits #55. Thanks to Elliotte Rusty Harold.
+o Minor Improvements #57, #61. Thanks to Arturo Bernal, Gary Gregory.
+o CLI-254: Input "test" gets parsed as test, quotes die #58. Thanks to stoty.
+o CLI-287: Allow whitespace-only header and footer #26. Thanks to MrQubo, Gary Gregory.
-o CLI-265: Optional argument picking up next regular option as its argument.
- Thanks to Martin Sandiford.
-o CLI-266: HelpFormatter.setOptionComparator(null) doesn't display the values
- in inserted order. Thanks to Ravi Teja.
-
-
- Release Notes for version 1.3.1
-
-BUG FIXES
-=========
-
-o CLI-252: LongOpt falsely detected as ambiguous. Thanks to Simon Harrer.
-
-
- Release Notes for version 1.3
-
-NOTES
-=====
-
-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.
-
-DEPRECATIONS
-============
-
-o org.apache.commons.cli.BasicParser
- replaced by org.apache.commons.cli.DefaultParser
-
-o org.apache.commons.cli.GnuParser
- replaced by org.apache.commons.cli.DefaultParser
-
-o org.apache.commons.cli.OptionBuilder
- replaced by org.apache.commons.cli.Option.builder()
- org.apache.commons.cli.Option.builder(String)
- org.apache.commons.cli.Option.Builder
-
-o org.apache.commons.cli.Parser
- replaced by org.apache.commons.cli.DefaultParser
-
-o org.apache.commons.cli.PosixParser
- replaced by org.apache.commons.cli.DefaultParser
-
-
-NEW FEATURES
-============
-
-o CLI-161: PosixParser doesn't stop the parsing on "--" tokens following an
- option with an argument
-o CLI-167: Support options like Java memory settings (-Xmx512M)
-o CLI-181: Unified Parser
-o CLI-224: Added new fluent API to create Option instances via builder class
- Option.Builder. This replaces the now deprecated OptionBuilder.
- Thanks to Duncan Jones, Brian Blount.
-o CLI-160: PosixParser now supports partial long options (--ver instead of
- --version).
-o CLI-169: HelpFormatter now supports setting the displayed separator of long
- options. Thanks to J. Lewis Muir.
-o CLI-214: Added new method Options.addOption(String, String). Thanks to
- Alexandru Mocanu.
-
-
-BUG FIXES
-=========
-
-o CLI-248: Dead links on doc page.
-o CLI-234: Fixed code example in javadoc of
- "Option#Builder#valueSeparator(char)". Thanks to Greg Thomas.
-o CLI-241: Clarified behavior of "OptionValidator#validateOption(String)"
- in case of null input. Thanks to Beluga Behr.
-o CLI-202: Default options will now work correctly with required options that
- are missing.
-o CLI-203: Default options will now work correctly together with option groups.
-o CLI-205: HelpFormatter.setArgName(String) now correctly sets the argument
- name.
-o CLI-204: Passing default values for not defined options to a parser will now
- trigger a ParseException instead of a NullPointerException.
-o CLI-201: Default properties provided as input to the Parser.parse() methods
- are now correctly processed.
-o CLI-215: CommandLine.getParsedOptionValue() now returns a String object if no
- option type has been explicitly set. Thanks to Manuel Müller.
-o CLI-212: HelpFormatter now prints command-line options in the same order as
- they have been added. Thanks to Per Cederberg.
-o CLI-186: Standard help text now shows mandatory arguments also for the first
- option. Thanks to Kristoff Kiefer.
-o CLI-207: HelpFormatter does not strip anymore leading whitespace in the
- footer text. Thanks to Uri Moszkowicz.
-o CLI-185: Strip quotes contained in argument values only if there is exactly
- one at the beginning and one at the end. Thanks to
- Einar M. R. Rosenvinge.
-o CLI-184: Negative numerical arguments take precedence over numerical options.
-o CLI-193: Fix possible StringIndexOutOfBoundsException in HelpFormatter.
- Thanks to Travis McLeskey.
-o CLI-183: OptionGroups no longer throw an AlreadySelectedException when reused
- for several parsings.
-o CLI-182: OptionGroup now selects properly an option with no short name.
-
-
-CHANGES
+Updates
=======
-o CLI-240: Small cleanup of Option class. Thanks to Beluga Behr.
-o CLI-230: Options.getRequiredOptions() now returns an unmodifiable list.
-o CLI-218: Clarify javadoc for CommandLine.getOptionValue() that the first
- specified argument will be returned. Thanks to Sven.
-o CLI-227: Changed unit tests to junit 4 annotation style. Thanks to
- Duncan Jones.
-o CLI-209: The javadoc of OptionBuilder now states that the class is not
- thread-safe. Thanks to Thomas Herre.
-o CLI-200: Fixed typo in javadoc of class CommandLine. Thanks to
- Gerard Weatherby.
-o CLI-223: Source code now uses generic types instead of raw types where
- possible. Thanks to Gerard Weatherby.
-o CLI-220 Corrected javadoc for return type of
- MissingOptionException.getMissingOptions(). Thanks to Joe Casadonte.
-o CLI-197: Improve description of parameter "stopAtNonOption" in method
- CommandLine.parse(Options, String[], boolean). Thanks to
- Anders Larsson.
-o CLI-231: Removed DoubleCheckedLocking test from checkstyle configuration.
- Thanks to Duncan Jones.
+o CLI-294: Update Java from version 5 to 7.
+o Docs: Replace OptionBuilder in usage page #30. Thanks to Mincong Huang.
+o Remove deprecated sudo setting. #36. Thanks to dengliming.
+o Bump junit:junit from 4.12 to 4.13.2, #53, #60. Thanks to Gary Gregory, Dependabot.
+o Bump commons-parent from 48 to 52. Thanks to Dependabot.
+o Bump maven-pmd-plugin from 3.12.0 to 3.15.0, #44, #54, #67. Thanks to Dependabot.
+o Bump actions/checkout from v2.3.1 to v2.3.5 #46, #72. Thanks to Dependabot.
+o Bump actions/setup-java from v1.4.2 to v2 #50. Thanks to Dependabot, Gary Gregory.
+o Bump maven-antrun-plugin from 1.7 to 3.0.0 #43. Thanks to Dependabot.
+o Bump maven-checkstyle-plugin from 2.15 to 3.1.2 #41. Thanks to Gary Gregory.
+o Bump checkstyle to 9.0.1 #68. Thanks to Gary Gregory.
+o Bump actions/cache from 2 to 2.1.6 #64, #65. Thanks to Dependabot.
+o Bump commons.animal-sniffer.version 1.19 -> 1.20. Thanks to Gary Gregory.
+o Bump maven-bundle-plugin 5.1.1 -> 5.1.2. Thanks to Gary Gregory.
+o Bump biz.aQute.bndlib.version 5.1.2 -> 6.0.0. Thanks to Gary Gregory.
+o Bump spotbugs from 4.4.1 to 4.4.2 #70. Thanks to Dependabot.
+o Bump spotbugs-maven-plugin from 4.4.1 to 4.4.2.2 #71. Thanks to Dependabot.
- Release Notes for version 1.2
+Historical list of changes: https://commons.apache.org/proper/commons-cli/changes-report.html
-NEW FEATURES
-============
+For complete information on Apache Commons CLI, including instructions on how to submit bug reports,
+patches, or suggestions for improvement, see the Apache Apache Commons CLI website:
-o -- : The method getOptionProperties() in the CommandLine class was added
- to retrieve easily the key/value pairs specified with options like
- -Dkey1=value1 -Dkey2=value2.
-o CLI-157: GnuParser now supports long options with an '=' sign
- (ie. --foo=bar and -foo=bar)
-o CLI-155: The ordering of options can be defined in help messages.
+https://commons.apache.org/proper/commons-cli/
-
-BUG FIXES
-=========
-
-o CLI-137: The number of arguments defined for an option specifies the
- arguments per occurence of the option and not for all occurences.
-o CLI-164: PosixParser no longer ignores unrecognized short options.
-o CLI-163: PosixParser no longer stops the bursting process of a token if
- stopAtNonOption is enabled and a non option character is
- encountered.
-o CLI-165: PosixParser no longer keeps processing the tokens after an
- unrecognized long option when stopAtNonOption is enabled.
-o CLI-156: Required options are properly checked if an Options instance is used
- twice to parse a command line.
-o CLI-151: The line wrapping in HelpFormatter now works properly.
-
-
-CHANGES
-=======
-
-o CLI-149: The message of MissingOptionException has been improved.
-o CLI-86: The exceptions have been enhanced with methods to retrieve easily
- the related options.
-o CLI-141: Option.toString() now reports arguments properly.
-o CLI-142: The Parser class has been changed to be more easily extendable.
-o CLI-140: The following classes are now serializable: Option, OptionGroup,
- CommandLine and Options.
-o -- : OptionValidator is no longer public, its methods were all private.
-
-
- Release Notes for version 1.1
-
-NEW FEATURES
-============
-
-o CLI-78: Setting description of a Option.
-
-CHANGES
-=======
-
-o CLI-2: Wrong usage summary.
-o CLI-5: Dependecy on commons-lang-2.0 but commons-lang-1.0 is obtained.
-o CLI-8: Line separator as first char for helpformatter (footer) throws
- exception.
-o CLI-13: CommandLine.getOptionValue() behaves contrary to docs.
-o CLI-21: clone method in Option should use super.clone().
-o CLI-23: Passing properties in Parser does not work for options with a single
- argument.
-o CLI-26: Only long options without short option seems to be noticed.
-o CLI-28: Infinite Loop in Command-Line processing.
-o CLI-29: Options should not be able to be added more than once.
-o CLI-35: HelpFormatter doesn't sort options properly.
-o CLI-38: HelpFormatter doesn't function correctly for options with only
- LongOpt.
-o CLI-44: Document enhancement.
-o CLI-45: Documentation errors.
-o CLI-51: Parameter value "-something" misinterpreted as a parameter.
-o CLI-56: clone() method doesn't fully clone contents.
-o CLI-59: No Javadoc for HelpFormatter!.
-o CLI-65: Parser breaks up command line parms into single characters.
-o CLI-67: Missing arguments in HelpFormatter.renderOptions(..).
-o CLI-69: Error parsing option arguments.
-o CLI-71: A weakness of parser.
-o CLI-129: CLI_1_BRANCH build.xml doesn't work.
-o CLI-130: Remove the Commons Lang dependency.
-o CLI-131: Options class returns options in random order.
-o CLI-132: MissingOptionException should contain a useful error message.
-o CLI-133: NullPointerException in Util.stripLeadingHyphens when passed a null
- argument.
-o CLI-134: 1.1 is not backwards compatible because it adds methods to the
- CommandLineParser interface.
-o CLI-135: Backwards compatibility between 1.1 and 1.0 broken due to
- Option.addValue removal.
-
-
-Historical list of changes: https://commons.apache.org/cli/changes-report.html
-
-For complete information on Commons CLI, including instructions on how to
-submit bug reports, patches, or suggestions for improvement, see the
-Apache Commons CLI website:
-
-https://commons.apache.org/cli/
+Download page: https://commons.apache.org/proper/commons-cli/download_cli.cgi
Have fun!
--Apache Commons CLI team
+The Apache Commons Team
+
+------------------------------------------------------------------------------
+
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 35e1518..1a939ca 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -20,7 +20,7 @@
<title>Apache Commons CLI Release Notes</title>
</properties>
<body>
- <release version="1.5.0" date="tba" description="New features and bug fixes (Java 7)">
+ <release version="1.5.0" date="tba" description="New features and bug fixes (Java 7).">
<!-- FIX -->
<action type="fix" dev="ggregory" due-to="Gary Gregory">
Fix NPE in DefaultParser.isLongOption(String).
diff --git a/src/changes/release-notes.vm b/src/changes/release-notes.vm
new file mode 100644
index 0000000..df36243
--- /dev/null
+++ b/src/changes/release-notes.vm
@@ -0,0 +1,128 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+${project.name}
+Version ${version}
+Release Notes
+
+
+This document contains the release notes for this version of the Apache Commons
+CLI Component of the Apache Commons Project. Commons CLI provides a simple API
+for working with the command line arguments and options.
+
+$introduction.replaceAll("(?<!\015)\012", "
+").replaceAll("(?m)^ +","")
+
+## N.B. the available variables are described here:
+## http://maven.apache.org/plugins/maven-changes-plugin/examples/using-a-custom-announcement-template.html
+##
+## Hack to improve layout: replace all pairs of spaces with a single new-line
+$release.description.replaceAll(" ", "
+")
+
+## set up indent sizes. Only change indent1
+#set($props=${project.properties})
+#set($jiralen=$props.get("commons.jira.id").length())
+## indent1 = POOL-nnnn:
+#set($blanklen=$jiralen+6)## +6 for "-nnnn:"
+## must be at least as long as the longest JIRA id
+#set($blanks=" ")
+#set($indent1=$blanks.substring(0,$blanklen))
+## indent2 allows for issue wrapper
+#set($indent2="$indent1 ")
+##
+#macro ( processaction )
+## Use replaceAll to fix up LF-only line ends on Windows.
+#set($action=$actionItem.getAction().replaceAll("\n","
+"))
+## Fix up indentation for multi-line action descriptions
+#set($action=$action.replaceAll("(?m)^ +",$indent2))
+#if ($actionItem.getIssue())
+#set($issue="$actionItem.getIssue():")
+## Pad shorter issue numbers
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
+#else
+#set($issue=$indent1)
+#end
+#if ($actionItem.getDueTo())
+#set($dueto=" Thanks to $actionItem.getDueTo().")
+#else
+#set($dueto="")
+#end
+o $issue ${action}$dueto
+#set($action="")
+#set($issue="")
+#set($dueto="")
+#end
+##
+#if ($release.getActions().size() == 0)
+No changes defined in this version.
+#else
+Changes in this version include:
+
+#if ($release.getActions('add').size() !=0)
+New Features
+============
+
+#foreach($actionItem in $release.getActions('add'))
+#processaction()
+#end
+#end
+
+#if ($release.getActions('fix').size() !=0)
+Fixed Bugs
+==========
+
+#foreach($actionItem in $release.getActions('fix'))
+#processaction()
+#end
+#end
+
+#if ($release.getActions('update').size() !=0)
+Updates
+=======
+
+#foreach($actionItem in $release.getActions('update'))
+#processaction()
+#end
+#end
+
+#if ($release.getActions('remove').size() !=0)
+Removed:
+#foreach($actionItem in $release.getActions('remove'))
+#processaction()
+#end
+#end
+## End of main loop
+#end
+
+Historical list of changes: ${project.url}changes-report.html
+
+For complete information on ${project.name}, including instructions on how to submit bug reports,
+patches, or suggestions for improvement, see the Apache ${project.name} website:
+
+${project.url}
+
+Download page: ${project.url}download_cli.cgi
+
+Have fun!
+The Apache Commons Team
+
+------------------------------------------------------------------------------
+
diff --git a/src/site/xdoc/download_cli.xml b/src/site/xdoc/download_cli.xml
index 96cf547..845cc7f 100644
--- a/src/site/xdoc/download_cli.xml
+++ b/src/site/xdoc/download_cli.xml
@@ -113,32 +113,32 @@
</p>
</subsection>
</section>
- <section name="Apache Commons CLI 1.5 ">
+ <section name="Apache Commons CLI 1.5.0 ">
<subsection name="Binaries">
<table>
<tr>
- <td><a href="[preferred]/commons/cli/binaries/commons-cli-1.5-bin.tar.gz">commons-cli-1.5-bin.tar.gz</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5-bin.tar.gz.sha512">sha512</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5-bin.tar.gz.asc">pgp</a></td>
+ <td><a href="[preferred]/commons/cli/binaries/commons-cli-1.5.0-bin.tar.gz">commons-cli-1.5.0-bin.tar.gz</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5.0-bin.tar.gz.sha512">sha512</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5.0-bin.tar.gz.asc">pgp</a></td>
</tr>
<tr>
- <td><a href="[preferred]/commons/cli/binaries/commons-cli-1.5-bin.zip">commons-cli-1.5-bin.zip</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5-bin.zip.sha512">sha512</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5-bin.zip.asc">pgp</a></td>
+ <td><a href="[preferred]/commons/cli/binaries/commons-cli-1.5.0-bin.zip">commons-cli-1.5.0-bin.zip</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5.0-bin.zip.sha512">sha512</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/binaries/commons-cli-1.5.0-bin.zip.asc">pgp</a></td>
</tr>
</table>
</subsection>
<subsection name="Source">
<table>
<tr>
- <td><a href="[preferred]/commons/cli/source/commons-cli-1.5-src.tar.gz">commons-cli-1.5-src.tar.gz</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5-src.tar.gz.sha512">sha512</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5-src.tar.gz.asc">pgp</a></td>
+ <td><a href="[preferred]/commons/cli/source/commons-cli-1.5.0-src.tar.gz">commons-cli-1.5.0-src.tar.gz</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5.0-src.tar.gz.sha512">sha512</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5.0-src.tar.gz.asc">pgp</a></td>
</tr>
<tr>
- <td><a href="[preferred]/commons/cli/source/commons-cli-1.5-src.zip">commons-cli-1.5-src.zip</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5-src.zip.sha512">sha512</a></td>
- <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5-src.zip.asc">pgp</a></td>
+ <td><a href="[preferred]/commons/cli/source/commons-cli-1.5.0-src.zip">commons-cli-1.5.0-src.zip</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5.0-src.zip.sha512">sha512</a></td>
+ <td><a href="https://www.apache.org/dist/commons/cli/source/commons-cli-1.5.0-src.zip.asc">pgp</a></td>
</tr>
</table>
</subsection>