Skip to content
Permalink
Browse files
[CLI-234] Fixed javadoc example of Option.Builder.valueSeparator(char…
…). Thanks to Greg Thomas.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/trunk@1544827 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
netomi committed Nov 23, 2013
1 parent b1ffe27 commit 8c14cb4b115b3bbb13f9702ddd3c13d66e073817
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
@@ -36,6 +36,8 @@ NEW FEATURES:

BUG FIXES:

* Fixed code example in javadoc of "Option#Builder#valueSeparator(char)". Thanks to Greg Thomas. (CLI-234)

* Clarified behavior of "OptionValidator#validateOption(String)" in case of null input. Thanks to Beluga Behr. (CLI-241)

* Default options will now work correctly with required options that are missing. (CLI-202)
11 pom.xml
@@ -85,9 +85,17 @@
<email>ebourg@apache.org</email>
<organization>Ariane Software</organization>
</developer>
<developer>
<name>Thomas Neidhart</name>
<id>tn</id>
<email>tn@apache.org</email>
</developer>
</developers>

<contributors>
<contributor>
<name>Beluga Behr</name>
</contributor>
<contributor>
<name>Peter Donald</name>
<roles>
@@ -133,6 +141,9 @@
<role>lots of fixes for 1.1</role>
</roles>
</contributor>
<contributor>
<name>Greg Thomas</name>
</contributor>
<contributor>
<name>Slawek Zachcial</name>
<roles>
@@ -23,6 +23,9 @@
<body>

<release version="1.3" date="in SVN" description="This is a maintenance release containing bug fixes.">
<action type="fix" dev="tn" issue="CLI-234" due-to="Greg Thomas">
Fixed code example in javadoc of "Option#Builder#valueSeparator(char)".
</action>
<action type="fix" dev="tn" issue="CLI-241" due-to="Beluga Behr">
Clarified behavior of "OptionValidator#validateOption(String)" in case of null input.
</action>
@@ -933,13 +933,16 @@ public Builder valueSeparator()
* <p>
* <b>Example:</b>
* <pre>
* Option opt = Option.builder("D").valueSeparator('=')
* Option opt = Option.builder("D").hasArgs()
* .valueSeparator('=')
* .build();
*
* String args = "-Dkey=value";
* CommandLine line = parser.parse(args);
* String propertyName = opt.getValue(0); // will be "key"
* String propertyValue = opt.getValue(1); // will be "value"
* Options options = new Options();
* options.addOption(opt);
* String[] args = {"-Dkey=value"};
* CommandLineParser parser = new DefaultParser();
* CommandLine line = parser.parse(options, args);
* String propertyName = line.getOptionValues("D")[0]; // will be "key"
* String propertyValue = line.getOptionValues("D")[1]; // will be "value"
* </pre>
*
* @param sep The value separator.

0 comments on commit 8c14cb4

Please sign in to comment.