File tree Expand file tree Collapse file tree
main/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ NEW FEATURES:
3636
3737BUG FIXES:
3838
39+ * Fixed code example in javadoc of "Option#Builder#valueSeparator(char)". Thanks to Greg Thomas. (CLI-234)
40+
3941 * Clarified behavior of "OptionValidator#validateOption(String)" in case of null input. Thanks to Beluga Behr. (CLI-241)
4042
4143 * Default options will now work correctly with required options that are missing. (CLI-202)
Original file line number Diff line number Diff line change 8585 <email >ebourg@apache.org</email >
8686 <organization >Ariane Software</organization >
8787 </developer >
88+ <developer >
89+ <name >Thomas Neidhart</name >
90+ <id >tn</id >
91+ <email >tn@apache.org</email >
92+ </developer >
8893 </developers >
8994
9095 <contributors >
96+ <contributor >
97+ <name >Beluga Behr</name >
98+ </contributor >
9199 <contributor >
92100 <name >Peter Donald</name >
93101 <roles >
133141 <role >lots of fixes for 1.1</role >
134142 </roles >
135143 </contributor >
144+ <contributor >
145+ <name >Greg Thomas</name >
146+ </contributor >
136147 <contributor >
137148 <name >Slawek Zachcial</name >
138149 <roles >
Original file line number Diff line number Diff line change 2323 <body >
2424
2525 <release version =" 1.3" date =" in SVN" description =" This is a maintenance release containing bug fixes." >
26+ <action type =" fix" dev =" tn" issue =" CLI-234" due-to =" Greg Thomas" >
27+ Fixed code example in javadoc of "Option#Builder#valueSeparator(char)".
28+ </action >
2629 <action type =" fix" dev =" tn" issue =" CLI-241" due-to =" Beluga Behr" >
2730 Clarified behavior of "OptionValidator#validateOption(String)" in case of null input.
2831 </action >
Original file line number Diff line number Diff line change @@ -933,13 +933,16 @@ public Builder valueSeparator()
933933 * <p>
934934 * <b>Example:</b>
935935 * <pre>
936- * Option opt = Option.builder("D").valueSeparator('=')
936+ * Option opt = Option.builder("D").hasArgs()
937+ * .valueSeparator('=')
937938 * .build();
938- *
939- * String args = "-Dkey=value";
940- * CommandLine line = parser.parse(args);
941- * String propertyName = opt.getValue(0); // will be "key"
942- * String propertyValue = opt.getValue(1); // will be "value"
939+ * Options options = new Options();
940+ * options.addOption(opt);
941+ * String[] args = {"-Dkey=value"};
942+ * CommandLineParser parser = new DefaultParser();
943+ * CommandLine line = parser.parse(options, args);
944+ * String propertyName = line.getOptionValues("D")[0]; // will be "key"
945+ * String propertyValue = line.getOptionValues("D")[1]; // will be "value"
943946 * </pre>
944947 *
945948 * @param sep The value separator.
You can’t perform that action at this time.
0 commit comments