You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/01/30 21:42:34 UTC

(commons-cli) branch release updated (824b1bf0 -> 4994a041)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch release
in repository https://gitbox.apache.org/repos/asf/commons-cli.git


    from 824b1bf0 Bump org.apache.commons:commons-parent from 80 to 81
     new 1d76328f Deprecate PatternOptionBuilder.PatternOptionBuilder()
     new 4994a041 Fix Javadoc warnings

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                                 |  1 +
 src/main/java/org/apache/commons/cli/BasicParser.java   |  8 ++++++++
 src/main/java/org/apache/commons/cli/GnuParser.java     |  8 ++++++++
 src/main/java/org/apache/commons/cli/HelpFormatter.java |  7 +++++++
 src/main/java/org/apache/commons/cli/OptionGroup.java   |  7 +++++++
 src/main/java/org/apache/commons/cli/Options.java       |  8 ++++++++
 src/main/java/org/apache/commons/cli/Parser.java        |  8 ++++++++
 .../org/apache/commons/cli/PatternOptionBuilder.java    | 10 ++++++++++
 src/main/java/org/apache/commons/cli/PosixParser.java   |  8 ++++++++
 src/main/javadoc/overview.html                          | 17 ++++++++++-------
 src/site/xdoc/index.xml                                 |  4 ++--
 src/site/xdoc/introduction.xml                          |  8 ++++----
 12 files changed, 81 insertions(+), 13 deletions(-)


(commons-cli) 01/02: Deprecate PatternOptionBuilder.PatternOptionBuilder()

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/commons-cli.git

commit 1d76328faeb36cfe37e72a0e274ce1a36020d320
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Jan 30 16:38:42 2025 -0500

    Deprecate PatternOptionBuilder.PatternOptionBuilder()
---
 src/changes/changes.xml                                        |  1 +
 src/main/java/org/apache/commons/cli/PatternOptionBuilder.java | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 27cfde06..cce1816c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -33,6 +33,7 @@
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Javadoc is missing its Overview page.</action>
       <action type="fix" dev="ggregory" due-to="Arnout Engelen">Get mockito version from parent pom (#351).</action>
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80).</action>
+      <action type="fix" dev="ggregory" due-to="Arnout Engelen">Deprecate PatternOptionBuilder.PatternOptionBuilder().</action>
       <!-- ADD -->
       <action type="add" issue="CLI-339" dev="ggregory" due-to="Claude Warren, Gary Gregory">Help formatter extension in the new package #314.</action>
       <action type="add" dev="ggregory" due-to="Gary Gregory">CommandLine.Builder implements Supplier&lt;CommandLine&gt;.</action>
diff --git a/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java b/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
index 547c890b..ba33eaa2 100644
--- a/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
+++ b/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
@@ -74,6 +74,16 @@ import java.util.Map;
  */
 public class PatternOptionBuilder {
 
+    /**
+     * Deprecated, only provides static methods.
+     *
+     * @deprecated Will be private or class will be final. 
+     */
+    @Deprecated
+    public PatternOptionBuilder() {
+        // empty
+    }
+
     /** String class */
     public static final Class<String> STRING_VALUE = String.class;
 


(commons-cli) 02/02: Fix Javadoc warnings

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/commons-cli.git

commit 4994a0415d73960c867ce4537e74363346e330f8
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Thu Jan 30 16:42:29 2025 -0500

    Fix Javadoc warnings
---
 src/main/java/org/apache/commons/cli/BasicParser.java   |  8 ++++++++
 src/main/java/org/apache/commons/cli/GnuParser.java     |  8 ++++++++
 src/main/java/org/apache/commons/cli/HelpFormatter.java |  7 +++++++
 src/main/java/org/apache/commons/cli/OptionGroup.java   |  7 +++++++
 src/main/java/org/apache/commons/cli/Options.java       |  8 ++++++++
 src/main/java/org/apache/commons/cli/Parser.java        |  8 ++++++++
 .../org/apache/commons/cli/PatternOptionBuilder.java    |  2 +-
 src/main/java/org/apache/commons/cli/PosixParser.java   |  8 ++++++++
 src/main/javadoc/overview.html                          | 17 ++++++++++-------
 src/site/xdoc/index.xml                                 |  4 ++--
 src/site/xdoc/introduction.xml                          |  8 ++++----
 11 files changed, 71 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/apache/commons/cli/BasicParser.java b/src/main/java/org/apache/commons/cli/BasicParser.java
index 63aaba79..622d78fe 100644
--- a/src/main/java/org/apache/commons/cli/BasicParser.java
+++ b/src/main/java/org/apache/commons/cli/BasicParser.java
@@ -25,6 +25,14 @@ package org.apache.commons.cli;
  */
 @Deprecated
 public class BasicParser extends Parser {
+
+    /**
+     * Constructs a new instance.
+     */
+    public BasicParser() {
+        // empty
+    }
+
     /**
      * <p>
      * A simple implementation of {@link Parser}'s abstract {@link Parser#flatten(Options, String[], boolean) flatten}
diff --git a/src/main/java/org/apache/commons/cli/GnuParser.java b/src/main/java/org/apache/commons/cli/GnuParser.java
index 6a5e84f6..692eaa42 100644
--- a/src/main/java/org/apache/commons/cli/GnuParser.java
+++ b/src/main/java/org/apache/commons/cli/GnuParser.java
@@ -28,6 +28,14 @@ import java.util.List;
  */
 @Deprecated
 public class GnuParser extends Parser {
+
+    /**
+     * Constructs a new instance.
+     */
+    public GnuParser() {
+        // empty
+    }
+
     /**
      * This flatten method does so using the following rules:
      * <ol>
diff --git a/src/main/java/org/apache/commons/cli/HelpFormatter.java b/src/main/java/org/apache/commons/cli/HelpFormatter.java
index 61ddfe32..2e12685a 100644
--- a/src/main/java/org/apache/commons/cli/HelpFormatter.java
+++ b/src/main/java/org/apache/commons/cli/HelpFormatter.java
@@ -78,6 +78,13 @@ public class HelpFormatter {
         // TODO All other instance HelpFormatter instance variables.
         // Make HelpFormatter immutable for 2.0
 
+        /**
+         * Constructs a new instance.
+         */
+        public Builder() {
+            // empty
+        }
+
         /**
          * A function to convert a description (not null) and a deprecated Option (not null) to help description
          */
diff --git a/src/main/java/org/apache/commons/cli/OptionGroup.java b/src/main/java/org/apache/commons/cli/OptionGroup.java
index 0685179a..6d1ad301 100644
--- a/src/main/java/org/apache/commons/cli/OptionGroup.java
+++ b/src/main/java/org/apache/commons/cli/OptionGroup.java
@@ -28,6 +28,13 @@ import java.util.Map;
  */
 public class OptionGroup implements Serializable {
 
+    /**
+     * Constructs a new instance.
+     */
+    public OptionGroup() {
+        // empty
+    }
+
     /** The serial version UID. */
     private static final long serialVersionUID = 1L;
 
diff --git a/src/main/java/org/apache/commons/cli/Options.java b/src/main/java/org/apache/commons/cli/Options.java
index bbbc8b2a..b4167aa6 100644
--- a/src/main/java/org/apache/commons/cli/Options.java
+++ b/src/main/java/org/apache/commons/cli/Options.java
@@ -39,6 +39,14 @@ import java.util.Map;
  * @see org.apache.commons.cli.CommandLine
  */
 public class Options implements Serializable {
+
+    /**
+     * Constructs new instance.
+     */
+    public Options() {
+        // empty
+    }
+
     /** The serial version UID. */
     private static final long serialVersionUID = 1L;
 
diff --git a/src/main/java/org/apache/commons/cli/Parser.java b/src/main/java/org/apache/commons/cli/Parser.java
index 9f7a40b4..fd9958b1 100644
--- a/src/main/java/org/apache/commons/cli/Parser.java
+++ b/src/main/java/org/apache/commons/cli/Parser.java
@@ -31,6 +31,7 @@ import java.util.Properties;
  */
 @Deprecated
 public abstract class Parser implements CommandLineParser {
+
     /** CommandLine instance */
     protected CommandLine cmd;
 
@@ -40,6 +41,13 @@ public abstract class Parser implements CommandLineParser {
     /** List of required options strings */
     private List requiredOptions;
 
+    /**
+     * Constructs a new instance.
+     */
+    public Parser() {
+        // empty
+    }
+
     /**
      * Throws a {@link MissingOptionException} if all of the required options are not present.
      *
diff --git a/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java b/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
index ba33eaa2..78b33267 100644
--- a/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
+++ b/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
@@ -77,7 +77,7 @@ public class PatternOptionBuilder {
     /**
      * Deprecated, only provides static methods.
      *
-     * @deprecated Will be private or class will be final. 
+     * @deprecated Will be private or class will be final.
      */
     @Deprecated
     public PatternOptionBuilder() {
diff --git a/src/main/java/org/apache/commons/cli/PosixParser.java b/src/main/java/org/apache/commons/cli/PosixParser.java
index 0a497146..5040c4c0 100644
--- a/src/main/java/org/apache/commons/cli/PosixParser.java
+++ b/src/main/java/org/apache/commons/cli/PosixParser.java
@@ -30,6 +30,7 @@ import java.util.List;
  */
 @Deprecated
 public class PosixParser extends Parser {
+
     /** Holder for flattened tokens */
     private final List<String> tokens = new ArrayList<>();
 
@@ -42,6 +43,13 @@ public class PosixParser extends Parser {
     /** The command line Options */
     private Options options;
 
+    /**
+     * Constructs a new instance.
+     */
+    public PosixParser() {
+        // empty
+    }
+
     /**
      * Breaks {@code token} into its constituent parts using the following algorithm.
      *
diff --git a/src/main/javadoc/overview.html b/src/main/javadoc/overview.html
index abba0061..045b8732 100644
--- a/src/main/javadoc/overview.html
+++ b/src/main/javadoc/overview.html
@@ -14,18 +14,21 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
+<html>
+<head>
+<title>Apache Commons CLI Overview</title>
+</head>
 <body>
+  <img src="../images/commons-logo.png" alt="Apache Commons CLI">
 
-    <p>Apache Commons CLI.</p>
+    <p>The Commons CLI component parses command-line arguments for your application.</p>
 
-    <p>The commons-cli package aides in parsing command-line arguments.</p>
-
-    <p>Allow command-line arguments to be parsed against a descriptor of
+    <p>Commons CLI parses command-line arguments using a descriptor of
     valid options (long and short), potentially with arguments.</p>
 
-    <p>command-line arguments may be of the typical {@code String[]}
-    form, but also may be a {@code java.util.List}.  Indexes allow
-    for parsing only a portion of the command-line.  Also, functionality
+    <p>Command-line arguments may be of the typical {@code String[]}
+    form, but also may be a {@code java.util.List}. Indexes allow
+    for parsing only a portion of the command-line. Also, functionality
     for parsing the command-line in phases is built in, allowing for
     'cvs-style' command-lines, where some global options are specified
     before a 'command' argument, and command-specific options are
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index 89ab52f5..713f84d8 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -28,8 +28,8 @@
   <body>
     <section name="Apache Commons CLI">
       <p>
-        The Apache Commons CLI library provides an API for parsing command line options passed to programs.
-        It's also able to print help messages detailing the options available for a command line tool.
+        The Apache Commons CLI library provides an API for parsing command-line options passed to an application.
+        It can also print help detailing the options available for that application.
       </p>
       <p>
         Commons CLI supports different types of options:
diff --git a/src/site/xdoc/introduction.xml b/src/site/xdoc/introduction.xml
index 3bc4d4fd..5fc48fbd 100644
--- a/src/site/xdoc/introduction.xml
+++ b/src/site/xdoc/introduction.xml
@@ -30,11 +30,11 @@
       <p>
         There are three stages to command line processing.  They are the
         definition, parsing and interrogation stages.  The following 
-        sections will discuss each of these stages in turn, and discuss how
+        sections discuss each of these stages in turn, and show how
         to implement them with CLI.
       </p>
     </section>
-    <section name="The Definition Stage">
+    <section name="Defining the CLI">
       <p>
         Each command line must define the set of options that will be used 
         to define the interface to the application.
@@ -58,7 +58,7 @@
         instance.
       </p>
     </section>
-    <section name="The Parsing Stage">
+    <section name="Parsing the CLI">
       <p>
         The parsing stage is where the text passed into the 
         application via the command line is processed.  The text is 
@@ -79,7 +79,7 @@
         instance.
       </p>
     </section>
-    <section name="The Interrogation Stage">
+    <section name="Interrogating the CLI">
       <p>
         The interrogation stage is where the application queries the
         <code>CommandLine</code> to decide what execution branch to