1- $Id$
2-
3- Commons CLI Package
1+ Apache Commons CLI
42 Version 1.3
53 Release Notes
64
@@ -11,89 +9,214 @@ This document contains the release notes for this version of the Commons CLI
119package. Commons CLI provides a simple API for working with the command line
1210arguments and options.
1311
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).
16-
17- More information can be found on the project site at http://commons.apache.org/cli
18-
19-
20- NEW FEATURES:
21-
22- * A new parser is available: DefaultParser. It combines the features of the GnuParser and the PosixParser.
23- It also provides additional features like partial matching for the long options, and long options without
24- separator (i.e like the JVM memory settings: -Xmx512m). This new parser deprecates the previous ones.
25- (CLI-161, CLI-167, CLI-181)
26-
27- * Added new fluent API to create Option instances via builder class Option.Builder.
28- This replaces the now deprecated OptionBuilder. Thanks to Duncan Jones, Brian Blount. (CLI-224)
29-
30- * PosixParser now supports partial long options (--ver instead of --version). (CLI-160)
31-
32- * HelpFormatter now supports setting the displayed separator of long options. Thanks to J. Lewis Muir. (CLI-169)
33-
34- * Added new method Options.addOption(String, String). Thanks to Alexandru Mocanu. (CLI-214)
35-
36-
37- BUG FIXES:
38-
39- * Fixed code example in javadoc of "Option#Builder#valueSeparator(char)". Thanks to Greg Thomas. (CLI-234)
40-
41- * Clarified behavior of "OptionValidator#validateOption(String)" in case of null input. Thanks to Beluga Behr. (CLI-241)
42-
43- * Default options will now work correctly with required options that are missing. (CLI-202)
44-
45- * Default options will now work correctly together with option groups. (CLI-203)
46-
47- * HelpFormatter.setArgName(String) now correctly sets the argument name. (CLI-205)
48-
49- * Passing default values for not defined options to a parser will now trigger
50- a ParseException instead of a NullPointerException. (CLI-204)
51-
52- * Default properties provided as input to the Parser.parse() methods are now
53- correctly processed. (CLI-201)
54-
55- * CommandLine.getParsedOptionValue() now returns a String object if no
56- option type has been explicitly set. Thanks to Manuel M�ller. (CLI-215)
57-
58- * HelpFormatter now prints command-line options in the same order as they
59- have been added. Thanks to Per Cederberg. (CLI-212)
60-
61- * Standard help text now shows mandatory arguments also for the first option. Thanks to Kristoff Kiefer. (CLI-186)
62-
63- * HelpFormatter does not strip anymore leading whitespace in the footer text. Thanks to Uri Moszkowicz. (CLI-207)
64-
65- * Strip quotes contained in argument values only if there is exactly one at the
66- beginning and one at the end. Thanks to Einar M R Rosenvinge. (CLI-185)
67-
68- * Negative numerical arguments take precedence over numerical options. (CLI-184)
69-
70- * Fix possible StringIndexOutOfBoundsException in HelpFormatter. Thanks to Travis McLeskey. (CLI-193)
71-
72- * OptionGroups no longer throw an AlreadySelectedException when reused for several parsings. (CLI-183)
73-
74- * OptionGroup now selects properly an option with no short name. (CLI-182)
75-
76-
77- CHANGES:
78-
79- * Small cleanup of Option class. Thanks to Beluga Behr. (CLI-240)
80-
81- * Options.getRequiredOptions() now returns an unmodifiable list. (CLI-230)
82-
83- * Clarify javadoc for CommandLine.getOptionValue() that the first specified
84- argument will be returned. Thanks to Sven. (CLI-218)
85-
86- * Changed unit tests to junit 4 annotation style. Thanks to Duncan Jones. (CLI-227)
87-
88- * The javadoc of OptionBuilder now states that the class is not thread-safe. Thanks to Thomas Herre. (CLI-209)
89-
90- * Fixed typo in javadoc of class CommandLine. Thanks to Gerard Weatherby. (CLI-200)
91-
92- * Source code now uses generic types instead of raw types where possible. Thanks to Gerard Weatherby. (CLI-223)
93-
94- * Corrected javadoc for return type of MissingOptionException.getMissingOptions(). Thanks to Joe Casadonte. (CLI-220)
95-
96- * Improve description of parameter "stopAtNonOption" in method
97- CommandLine.parse(Options, String[], boolean). Thanks to Anders Larsson. (CLI-197)
98-
99- * Removed DoubleCheckedLocking test from checkstyle configuration. Thanks to Duncan Jones. (CLI-231)
12+ Commons CLI 1.3 is a bugfix release and binary compatible with the previous
13+ versions, except for the OptionValidator class that is no longer public
14+ (change introduced in v1.2). Commons CLI 1.3 at least requires Java 5.0.
15+
16+ More information can be found on the project site at
17+ http://commons.apache.org/cli.
18+
19+ NOTES
20+ =====
21+
22+ A new parser is available: DefaultParser. It combines the features of the
23+ GnuParser and the PosixParser. It also provides additional features like
24+ partial matching for the long options, and long options without
25+ separator (i.e like the JVM memory settings: -Xmx512m). This new parser
26+ deprecates the previous ones.
27+
28+ DEPRECATIONS
29+ ============
30+
31+ o org.apache.commons.cli.BasicParser
32+ replaced by org.apache.commons.cli.DefaultParser
33+
34+ o org.apache.commons.cli.GnuParser
35+ replaced by org.apache.commons.cli.DefaultParser
36+
37+ o org.apache.commons.cli.OptionBuilder
38+ replaced by org.apache.commons.cli.Option.builder()
39+ org.apache.commons.cli.Option.builder(String)
40+ org.apache.commons.cli.Option.Builder
41+
42+ o org.apache.commons.cli.Parser
43+ replaced by org.apache.commons.cli.DefaultParser
44+
45+ o org.apache.commons.cli.PosixParser
46+ replaced by org.apache.commons.cli.DefaultParser
47+
48+
49+ NEW FEATURES
50+ ============
51+
52+ o CLI-161: PosixParser doesn't stop the parsing on "--" tokens following an
53+ option with an argument
54+ o CLI-167: Support options like Java memory settings (-Xmx512M)
55+ o CLI-181: Unified Parser
56+ o CLI-224: Added new fluent API to create Option instances via builder class
57+ Option.Builder. This replaces the now deprecated OptionBuilder.
58+ Thanks to Duncan Jones, Brian Blount.
59+ o CLI-160: PosixParser now supports partial long options (--ver instead of
60+ --version).
61+ o CLI-169: HelpFormatter now supports setting the displayed separator of long
62+ options. Thanks to J. Lewis Muir.
63+ o CLI-214: Added new method Options.addOption(String, String). Thanks to
64+ Alexandru Mocanu.
65+
66+
67+ BUG FIXES
68+ =========
69+
70+ o CLI-234: Fixed code example in javadoc of
71+ "Option#Builder#valueSeparator(char)". Thanks to Greg Thomas.
72+ o CLI-241: Clarified behavior of "OptionValidator#validateOption(String)"
73+ in case of null input. Thanks to Beluga Behr.
74+ o CLI-202: Default options will now work correctly with required options that
75+ are missing.
76+ o CLI-203: Default options will now work correctly together with option groups.
77+ o CLI-205: HelpFormatter.setArgName(String) now correctly sets the argument
78+ name.
79+ o CLI-204: Passing default values for not defined options to a parser will now
80+ trigger a ParseException instead of a NullPointerException.
81+ o CLI-201: Default properties provided as input to the Parser.parse() methods
82+ are now correctly processed.
83+ o CLI-215: CommandLine.getParsedOptionValue() now returns a String object if no
84+ option type has been explicitly set. Thanks to Manuel M�ller.
85+ o CLI-212: HelpFormatter now prints command-line options in the same order as
86+ they have been added. Thanks to Per Cederberg.
87+ o CLI-186: Standard help text now shows mandatory arguments also for the first
88+ option. Thanks to Kristoff Kiefer.
89+ o CLI-207: HelpFormatter does not strip anymore leading whitespace in the
90+ footer text. Thanks to Uri Moszkowicz.
91+ o CLI-185: Strip quotes contained in argument values only if there is exactly
92+ one at the beginning and one at the end. Thanks to
93+ Einar M. R. Rosenvinge.
94+ o CLI-184: Negative numerical arguments take precedence over numerical options.
95+ o CLI-193: Fix possible StringIndexOutOfBoundsException in HelpFormatter.
96+ Thanks to Travis McLeskey.
97+ o CLI-183: OptionGroups no longer throw an AlreadySelectedException when reused
98+ for several parsings.
99+ o CLI-182: OptionGroup now selects properly an option with no short name.
100+
101+
102+ CHANGES
103+ =======
104+
105+ o CLI-240: Small cleanup of Option class. Thanks to Beluga Behr.
106+ o CLI-230: Options.getRequiredOptions() now returns an unmodifiable list.
107+ o CLI-218: Clarify javadoc for CommandLine.getOptionValue() that the first
108+ specified argument will be returned. Thanks to Sven.
109+ o CLI-227: Changed unit tests to junit 4 annotation style. Thanks to
110+ Duncan Jones.
111+ o CLI-209: The javadoc of OptionBuilder now states that the class is not
112+ thread-safe. Thanks to Thomas Herre.
113+ o CLI-200: Fixed typo in javadoc of class CommandLine. Thanks to
114+ Gerard Weatherby.
115+ o CLI-223: Source code now uses generic types instead of raw types where
116+ possible. Thanks to Gerard Weatherby.
117+ o CLI-220 Corrected javadoc for return type of
118+ MissingOptionException.getMissingOptions(). Thanks to Joe Casadonte.
119+ o CLI-197: Improve description of parameter "stopAtNonOption" in method
120+ CommandLine.parse(Options, String[], boolean). Thanks to
121+ Anders Larsson.
122+ o CLI-231: Removed DoubleCheckedLocking test from checkstyle configuration.
123+ Thanks to Duncan Jones.
124+
125+
126+ Release Notes for version 1.2
127+
128+ NEW FEATURES
129+ ============
130+
131+ o -- : The method getOptionProperties() in the CommandLine class was added
132+ to retrieve easily the key/value pairs specified with options like
133+ -Dkey1=value1 -Dkey2=value2.
134+ o CLI-157: GnuParser now supports long options with an '=' sign
135+ (ie. --foo=bar and -foo=bar)
136+ o CLI-155: The ordering of options can be defined in help messages.
137+
138+
139+ BUG FIXES
140+ =========
141+
142+ o CLI-137: The number of arguments defined for an option specifies the
143+ arguments per occurence of the option and not for all occurences.
144+ o CLI-164: PosixParser no longer ignores unrecognized short options.
145+ o CLI-163: PosixParser no longer stops the bursting process of a token if
146+ stopAtNonOption is enabled and a non option character is
147+ encountered.
148+ o CLI-165: PosixParser no longer keeps processing the tokens after an
149+ unrecognized long option when stopAtNonOption is enabled.
150+ o CLI-156: Required options are properly checked if an Options instance is used
151+ twice to parse a command line.
152+ o CLI-151: The line wrapping in HelpFormatter now works properly.
153+
154+
155+ CHANGES
156+ =======
157+
158+ o CLI-149: The message of MissingOptionException has been improved.
159+ o CLI-86: The exceptions have been enhanced with methods to retrieve easily
160+ the related options.
161+ o CLI-141: Option.toString() now reports arguments properly.
162+ o CLI-142: The Parser class has been changed to be more easily extendable.
163+ o CLI-140: The following classes are now serializable: Option, OptionGroup,
164+ CommandLine and Options.
165+ o -- : OptionValidator is no longer public, its methods were all private.
166+
167+
168+ Release Notes for version 1.1
169+
170+ NEW FEATURES
171+ ============
172+
173+ o CLI-78: Setting description of a Option.
174+
175+ CHANGES
176+ =======
177+
178+ o CLI-2: Wrong usage summary.
179+ o CLI-5: Dependecy on commons-lang-2.0 but commons-lang-1.0 is obtained.
180+ o CLI-8: Line separator as first char for helpformatter (footer) throws
181+ exception.
182+ o CLI-13: CommandLine.getOptionValue() behaves contrary to docs.
183+ o CLI-21: clone method in Option should use super.clone().
184+ o CLI-23: Passing properties in Parser does not work for options with a single
185+ argument.
186+ o CLI-26: Only long options without short option seems to be noticed.
187+ o CLI-28: Infinite Loop in Command-Line processing.
188+ o CLI-29: Options should not be able to be added more than once.
189+ o CLI-35: HelpFormatter doesn't sort options properly.
190+ o CLI-38: HelpFormatter doesn't function correctly for options with only
191+ LongOpt.
192+ o CLI-44: Document enhancement.
193+ o CLI-45: Documentation errors.
194+ o CLI-51: Parameter value "-something" misinterpreted as a parameter.
195+ o CLI-56: clone() method doesn't fully clone contents.
196+ o CLI-59: No Javadoc for HelpFormatter!.
197+ o CLI-65: Parser breaks up command line parms into single characters.
198+ o CLI-67: Missing arguments in HelpFormatter.renderOptions(..).
199+ o CLI-69: Error parsing option arguments.
200+ o CLI-71: A weakness of parser.
201+ o CLI-129: CLI_1_BRANCH build.xml doesn't work.
202+ o CLI-130: Remove the Commons Lang dependency.
203+ o CLI-131: Options class returns options in random order.
204+ o CLI-132: MissingOptionException should contain a useful error message.
205+ o CLI-133: NullPointerException in Util.stripLeadingHyphens when passed a null
206+ argument.
207+ o CLI-134: 1.1 is not backwards compatible because it adds methods to the
208+ CommandLineParser interface.
209+ o CLI-135: Backwards compatibility between 1.1 and 1.0 broken due to
210+ Option.addValue removal.
211+
212+
213+ Historical list of changes: http://commons.apache.org/cli/changes-report.html
214+
215+ For complete information on Commons CLI, including instructions on how to
216+ submit bug reports, patches, or suggestions for improvement, see the
217+ Apache Commons CLI website:
218+
219+ http://commons.apache.org/cli/
220+
221+ Have fun!
222+ -Apache Commons CLI team
0 commit comments