You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2016/07/27 18:47:24 UTC
svn commit: r1754331 -
/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java
Author: britter
Date: Wed Jul 27 18:47:24 2016
New Revision: 1754331
URL: http://svn.apache.org/viewvc?rev=1754331&view=rev
Log:
JavaDoc tweaks
Modified:
commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java
Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java?rev=1754331&r1=1754330&r2=1754331&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java Wed Jul 27 18:47:24 2016
@@ -98,7 +98,10 @@ public class Options implements Serializ
/**
* Add an option that only contains a short name.
+ *
+ * <p>
* The option does not take an argument.
+ * </p>
*
* @param opt Short single-character name of the option.
* @param description Self-documenting description
@@ -113,7 +116,10 @@ public class Options implements Serializ
/**
* Add an option that only contains a short-name.
+ *
+ * <p>
* It may be specified as requiring an argument.
+ * </p>
*
* @param opt Short single-character name of the option.
* @param hasArg flag signally if an argument is required after this option
@@ -128,7 +134,10 @@ public class Options implements Serializ
/**
* Add an option that contains a short-name and a long-name.
+ *
+ * <p>
* It may be specified as requiring an argument.
+ * </p>
*
* @param opt Short single-character name of the option.
* @param longOpt Long multi-character name of the option.
@@ -144,8 +153,18 @@ public class Options implements Serializ
/**
* Add an option that contains a short-name and a long-name.
- * This option is set as required.
- * It may be specified as requiring an argument.
+ *
+ * <p>
+ * The added option is set as required. It may be specified as requiring an argument. This method is a shortcut for:
+ * </p>
+ *
+ * <pre>
+ * <code>
+ * Options option = new Option(opt, longOpt, hasArg, description);
+ * option.setRequired(true);
+ * options.add(option);
+ * </code>
+ * </pre>
*
* @param opt Short single-character name of the option.
* @param longOpt Long multi-character name of the option.
@@ -224,7 +243,10 @@ public class Options implements Serializ
/**
* Retrieve the {@link Option} matching the long or short name specified.
+ *
+ * <p>
* The leading hyphens in the name are ignored (up to 2).
+ * </p>
*
* @param opt short or long name of the {@link Option}
* @return the option represented by opt
@@ -314,10 +336,9 @@ public class Options implements Serializ
/**
* Returns the OptionGroup the <code>opt</code> belongs to.
- * @param opt the option whose OptionGroup is being queried.
*
- * @return the OptionGroup if <code>opt</code> is part
- * of an OptionGroup, otherwise return null
+ * @param opt the option whose OptionGroup is being queried.
+ * @return the OptionGroup if <code>opt</code> is part of an OptionGroup, otherwise return null
*/
public OptionGroup getOptionGroup(Option opt)
{