Skip to content

Commit 35b896a

Browse files
committed
Move Properties documentation section to Javadoc
1 parent 224ea09 commit 35b896a

File tree

3 files changed

+95
-124
lines changed

3 files changed

+95
-124
lines changed

src/main/javadoc/overview.html

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,5 +650,98 @@ <h2>Changing help format</h2>
650650
Use '-count' instead</code></pre>
651651
</section>
652652
</section>
653-
653+
<section id="Properties">
654+
<h1>Defining Option Properties</h1>
655+
<p>
656+
The following are the properties that each
657+
<a href="javadocs/api-release/org/apache/commons/cli/Option.html">Option</a> has. All of these
658+
can be set using the accessors or using the methods
659+
defined in the
660+
<a href="javadocs/api-release/org/apache/commons/cli/Option.Builder.html">Option.Builder</a>.
661+
</p>
662+
<table>
663+
<caption>Option Properties</caption>
664+
<tr>
665+
<th>Name</th>
666+
<th>Type</th>
667+
<th>Description</th>
668+
</tr>
669+
<tr>
670+
<td>arg</td>
671+
<td>boolean</td>
672+
<td>A flag to say whether the option takes an argument.</td>
673+
</tr>
674+
<tr>
675+
<td>args</td>
676+
<td>boolean</td>
677+
<td>A flag to say whether the option takes more than one argument.</td>
678+
</tr>
679+
<tr>
680+
<td>argName</td>
681+
<td>java.lang.String</td>
682+
<td>The name of the argument value for the usage statement.</td>
683+
</tr>
684+
<tr>
685+
<td>converter</td>
686+
<td>org.apache.commons.cli.Converter&lt;T, E extends Throwable&gt;</td>
687+
<td>A FunctionalInterface that converts a String to type T and may throw an exception E. When
688+
CommandLine.getParsedValue() is called this FunctionalInterface will perform the conversion from the
689+
command line argument to the parsed type. This is used when a desired type is not registered, or to
690+
provide a custom type implementation. The 'type' property is not required to use the 'converter' property.</td>
691+
</tr>
692+
<tr>
693+
<td>deprecated</td>
694+
<td>org.apache.commons.cli.DeprecatedAttributes</td>
695+
<td>Marks the option as deprecated and has the deprecation properties.</td>
696+
</tr>
697+
<tr>
698+
<td>description</td>
699+
<td>java.lang.String</td>
700+
<td>A description of the function of the option.</td>
701+
</tr>
702+
<tr>
703+
<td>longOpt</td>
704+
<td>java.lang.String</td>
705+
<td>An alias and more descriptive identification string. May be null or not specified if 'opt' is provided.</td>
706+
</tr>
707+
<tr>
708+
<td>opt</td>
709+
<td>java.lang.String</td>
710+
<td>The identification string of the Option. May be null or not specified if 'longOpt' is provided.</td>
711+
</tr>
712+
<tr>
713+
<td>optionalArg</td>
714+
<td>boolean</td>
715+
<td>A flag to say whether the option's argument is optional.</td>
716+
</tr>
717+
<tr>
718+
<td>required</td>
719+
<td>boolean</td>
720+
<td>A flag to say whether the option <b>must</b> appear on the command line.</td>
721+
</tr>
722+
<tr>
723+
<td>type</td>
724+
<td>java.lang.Class&lt;?&gt;</td>
725+
<td>The class of the object returned from getParsedValue(). The class must be registered in TypeHandler instance.
726+
See also 'converter' property.</td>
727+
</tr>
728+
<tr>
729+
<td>value</td>
730+
<td>java.lang.String</td>
731+
<td>The value of the option.</td>
732+
</tr>
733+
<tr>
734+
<td>values</td>
735+
<td>java.lang.String[]</td>
736+
<td>The values of the option.</td>
737+
</tr>
738+
<tr>
739+
<td>valueSeparator</td>
740+
<td>char</td>
741+
<td>The character value used to split the argument string, that is used in conjunction with multipleArgs e.g.
742+
if the separator is ',' and the argument string is 'a,b,c' then there are three argument values, 'a', 'b'
743+
and 'c'.</td>
744+
</tr>
745+
</table>
746+
</section>
654747
</body>

src/site/site.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<menu name="User Guide">
4848
<item name="Getting started" href="/introduction.html"/>
4949
<item name="Using CLI" href="/apidocs/index.html#Using"/>
50-
<item name="Option properties" href="/properties.html"/>
50+
<item name="Option properties" href="/apidocs/index.html#Properties"/>
5151
<item name="Javadoc" href="/apidocs/index.html"/>
5252
<item name="Javadoc Archive" href="https://javadoc.io/doc/commons-cli/commons-cli/latest/index.html"/>
5353
</menu>

src/site/xdoc/properties.xml

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)