11$Id$
22
33 Commons CLI Package
4- Version 1.2
4+ Version 1.3
55 Release Notes
66
77
@@ -11,70 +11,81 @@ This document contains the release notes for this version of the Commons CLI
1111package. Commons CLI provides a simple API for working with the command line
1212arguments and options.
1313
14- Commons CLI 1.2 is a bugfix release. The following notable changes were made:
15-
16- * A major regression introduced in CLI 1.1 that prevented the usage of repeated options has been fixed.
17- * Several parser issues have been fixed, especially with the PosixParser.
18- * HelpFormatter now wraps the lines properly
19- * The ordering of the option in the help message can now be defined.
20- * Various API enhancements (improved exceptions, serializable classes)
21-
22- Commons CLI 1.2 is binary compatible with the previous versions, except for
23- the OptionValidator class that is no longer public.
14+ Commons CLI 1.3 is a bugfix release and binary compatible with the previous versions,
15+ except for the OptionValidator class that is no longer public (change introduced in v1.2).
2416
2517More information can be found on the project site at http://commons.apache.org/cli
2618
2719
2820NEW FEATURES:
2921
30- * The method getOptionProperties() in the CommandLine class was added
31- to retrieve easily the key/value pairs specified with options like
32- -Dkey1=value1 -Dkey2=value2.
22+ * Added new fluent API to create Option instances via builder class Option.Builder.
23+ This replaces the now deprecated OptionBuilder. Thanks to Duncan Jones, Brian Blount. (CLI-224)
3324
34- * GnuParser now supports long options with an '=' sign
35- (ie. --foo=bar and -foo=bar) (CLI-157)
25+ * Added new method Options.addOption(String, String). Thanks to Alexandru Mocanu. (CLI-214)
26+
27+ * A new parser is available: DefaultParser. It combines the features of the GnuParser and the PosixParser.
28+ It also provides additional features like partial matching for the long options, and long options without
29+ separator (i.e like the JVM memory settings: -Xmx512m). This new parser deprecates the previous ones.
30+ (CLI-161, CLI-167, CLI-181)
3631
37- * The ordering of options can be defined in help messages. (CLI-155)
32+ * PosixParser now supports partial long options (--ver instead of --version). (CLI-160)
33+
34+ * HelpFormatter now supports setting the displayed separator of long options. Thanks to J. Lewis Muir. (CLI-169)
3835
3936
4037BUG FIXES:
4138
42- * The number of arguments defined for an option specifies the arguments
43- per occurrence of the option and not for all occurrences. (CLI-137)
39+ * Default options will now work correctly with required options that are missing. (CLI-202)
4440
45- * PosixParser no longer ignores unrecognized short options. (CLI-164)
41+ * Default options will now work correctly together with option groups. (CLI-203)
42+
43+ * HelpFormatter.setArgName(String) now correctly sets the argument name. (CLI-205)
4644
47- * PosixParser no longer stops the bursting process of a token if stopAtNonOption
48- is enabled and a non option character is encountered . (CLI-163 )
45+ * Passing default values for not defined options to a parser will now trigger
46+ a ParseException instead of a NullPointerException . (CLI-204 )
4947
50- * PosixParser no longer keeps processing the tokens after an unrecognized
51- long option when stopAtNonOption is enabled . (CLI-165 )
48+ * Default properties provided as input to the Parser.parse() methods are now
49+ correctly processed . (CLI-201 )
5250
53- * Required options are properly checked if an Options instance is used twice
54- to parse a command line. (CLI-156)
51+ * CommandLine.getParsedOptionValue() now returns a String object if no
52+ option type has been explicitly set. Thanks to Manuel M�ller. (CLI-215)
53+
54+ * HelpFormatter now prints command-line options in the same order as they
55+ have been added. Thanks to Per Cederberg. (CLI-212)
5556
56- * The line wrapping in HelpFormatter now works properly. (CLI-151) (CLI-162 )
57+ * Standard help text now shows mandatory arguments also for the first option. Thanks to Kristoff Kiefer. (CLI-186 )
5758
58- * OptionBuilder is now reset back to a blank state when it throws an
59- Exception. (CLI-177)
59+ * HelpFormatter does not strip anymore leading whitespace in the footer text. Thanks to Uri Moszkowicz. (CLI-207)
6060
61+ * Strip quotes contained in argument values only if there is exactly one at the
62+ beginning and one at the end. Thanks to Einar M R Rosenvinge. (CLI-185)
6163
62- CHANGES:
64+ * Negative numerical arguments take precedence over numerical options. (CLI-184)
6365
64- * The message of MissingOptionException has been improved . (CLI-149 )
66+ * Fix possible StringIndexOutOfBoundsException in HelpFormatter. Thanks to Travis McLeskey . (CLI-193 )
6567
66- * The exceptions have been enhanced with methods to retrieve easily
67- the related options. (CLI-86)
68+ * OptionGroups no longer throw an AlreadySelectedException when reused for several parsings. (CLI-183)
69+
70+ * OptionGroup now selects properly an option with no short name. (CLI-182)
71+
72+
73+ CHANGES:
6874
69- * Option.toString () now reports arguments properly . (CLI-141)
75+ * Options.getRequiredOptions () now returns an unmodifiable list . (CLI-230)
7076
71- * The Parser class has been changed to be more easily extendable. (CLI-142)
77+ * Clarify javadoc for CommandLine.getOptionValue() that the first specified
78+ argument will be returned. Thanks to Sven. (CLI-218)
7279
73- * The following classes are now serializable: Option, OptionGroup,
74- CommandLine and Options. (CLI-140)
80+ * Changed unit tests to junit 4 annotation style. Thanks to Duncan Jones. (CLI-227)
7581
76- * OptionValidator is no longer public, its methods were all private.
82+ * The javadoc of OptionBuilder now states that the class is not thread-safe. Thanks to Thomas Herre. (CLI-209)
7783
78- * TypeHandler no longer prints to stderr. (CLI-170)
84+ * Fixed typo in javadoc of class CommandLine. Thanks to Gerard Weatherby. (CLI-200)
85+
86+ * Source code now uses generic types instead of raw types where possible. Thanks to Gerard Weatherby. (CLI-223)
7987
88+ * Corrected javadoc for return type of MissingOptionException.getMissingOptions(). Thanks to Joe Casadonte. (CLI-220)
8089
90+ * Improve description of parameter "stopAtNonOption" in method
91+ CommandLine.parse(Options, String[], boolean). Thanks to Anders Larsson. (CLI-197)
0 commit comments