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 2021/10/17 14:42:34 UTC
[commons-cli] branch master updated (ff7c287 -> ac96d62)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-cli.git.
from ff7c287 Input "test" gets parsed as test, quotes die #58.
new 7b52ba8 Javadoc.
new ac96d62 No need to nest.
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:
.../java/org/apache/commons/cli/DefaultParser.java | 35 +++++++++++-----------
1 file changed, 17 insertions(+), 18 deletions(-)
[commons-cli] 02/02: No need to nest.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-cli.git
commit ac96d6242fa9c88f7fad3b3a08b8a5f11fa2b979
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 17 10:42:32 2021 -0400
No need to nest.
---
src/main/java/org/apache/commons/cli/DefaultParser.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/cli/DefaultParser.java b/src/main/java/org/apache/commons/cli/DefaultParser.java
index 523c0ee..40f1fec 100644
--- a/src/main/java/org/apache/commons/cli/DefaultParser.java
+++ b/src/main/java/org/apache/commons/cli/DefaultParser.java
@@ -656,9 +656,8 @@ public class DefaultParser implements CommandLineParser {
private String stripLeadingAndTrailingQuotesDefaultOff(final String token) {
if (stripLeadingAndTrailingQuotes != null && stripLeadingAndTrailingQuotes) {
return Util.stripLeadingAndTrailingQuotes(token);
- } else {
- return token;
}
+ return token;
}
/**
@@ -671,9 +670,8 @@ public class DefaultParser implements CommandLineParser {
private String stripLeadingAndTrailingQuotesDefaultOn(final String token) {
if (stripLeadingAndTrailingQuotes == null || stripLeadingAndTrailingQuotes) {
return Util.stripLeadingAndTrailingQuotes(token);
- } else {
- return token;
}
+ return token;
}
/**
[commons-cli] 01/02: Javadoc.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-cli.git
commit 7b52ba80498be2c019d7b4cba9e1af9bce2b7e2e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 17 10:42:17 2021 -0400
Javadoc.
---
.../java/org/apache/commons/cli/DefaultParser.java | 29 +++++++++++-----------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/src/main/java/org/apache/commons/cli/DefaultParser.java b/src/main/java/org/apache/commons/cli/DefaultParser.java
index 4a3a65b..523c0ee 100644
--- a/src/main/java/org/apache/commons/cli/DefaultParser.java
+++ b/src/main/java/org/apache/commons/cli/DefaultParser.java
@@ -28,6 +28,7 @@ import java.util.Properties;
* @since 1.3
*/
public class DefaultParser implements CommandLineParser {
+
/** The command-line instance. */
protected CommandLine cmd;
@@ -123,7 +124,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Throw a {@link MissingArgumentException} if the current option didn't receive the number of arguments expected.
+ * Throws a {@link MissingArgumentException} if the current option didn't receive the number of arguments expected.
*/
private void checkRequiredArgs() throws ParseException {
if (currentOption != null && currentOption.requiresArg()) {
@@ -144,7 +145,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Search for a prefix that is the long name of an option (-Xmx512m)
+ * Searches for a prefix that is the long name of an option (-Xmx512m)
*
* @param token
*/
@@ -421,7 +422,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Handle any command line token.
+ * Handles any command line token.
*
* @param token the command line token to handle
* @throws ParseException
@@ -467,7 +468,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Returns true is the token is a valid argument.
+ * Tests if the token is a valid argument.
*
* @param token
*/
@@ -476,7 +477,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Check if the specified token is a Java-like property (-Dkey=value).
+ * Tests if the specified token is a Java-like property (-Dkey=value).
*/
private boolean isJavaProperty(final String token) {
final String opt = token.substring(0, 1);
@@ -486,7 +487,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Tells if the token looks like a long option.
+ * Tests if the token looks like a long option.
*
* @param token
*/
@@ -511,7 +512,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Check if the token is a negative number.
+ * Tests if the token is a negative number.
*
* @param token
*/
@@ -525,7 +526,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Tells if the token looks like an option.
+ * Tests if the token looks like an option.
*
* @param token
*/
@@ -534,7 +535,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Tells if the token looks like a short option.
+ * Tests if the token looks like a short option.
*
* @param token
*/
@@ -565,7 +566,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Parse the arguments according to the specified options and properties.
+ * Parses the arguments according to the specified options and properties.
*
* @param options the specified Options
* @param arguments the command line arguments
@@ -579,7 +580,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Parse the arguments according to the specified options and properties.
+ * Parses the arguments according to the specified options and properties.
*
* @param options the specified Options
* @param arguments the command line arguments
@@ -646,7 +647,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Strip balanced leading and trailing quotes if the stripLeadingAndTrailingQuotes is set
+ * Strips balanced leading and trailing quotes if the stripLeadingAndTrailingQuotes is set
* If stripLeadingAndTrailingQuotes is null, then do not strip
*
* @param token a string
@@ -661,7 +662,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Strip balanced leading and trailing quotes if the stripLeadingAndTrailingQuotes is set
+ * Strips balanced leading and trailing quotes if the stripLeadingAndTrailingQuotes is set
* If stripLeadingAndTrailingQuotes is null, then do not strip
*
* @param token a string
@@ -676,7 +677,7 @@ public class DefaultParser implements CommandLineParser {
}
/**
- * Returns a {@link Builder} to create an {@link DefaultParser} using descriptive
+ * Creates a new {@link Builder} to create an {@link DefaultParser} using descriptive
* methods.
*
* @return a new {@link Builder} instance