garydgregory commented on code in PR #379:
URL: https://github.com/apache/commons-cli/pull/379#discussion_r2137683423
##########
src/main/java/org/apache/commons/cli/DefaultParser.java:
##########
@@ -711,11 +764,29 @@ public CommandLine parse(final Options options, final
String[] arguments, final
*
* @return the list of atomic option and value tokens
* @throws ParseException if there are any problems encountered while
parsing the command line tokens.
+ * @see #parse(Options, String[], Properties, NonOptionAction)
*/
public CommandLine parse(final Options options, final String[] arguments,
final Properties properties, final boolean stopAtNonOption)
throws ParseException {
+ return parse(options, arguments, properties, stopAtNonOption ?
NonOptionAction.STOP : NonOptionAction.THROW);
+ }
+
+ /**
+ * Parses the arguments according to the specified options and properties.
+ *
+ * @param options the specified Options
+ * @param arguments the command line arguments
+ * @param properties command line option name-value pairs
+ * @param nonOptionAction see {@link NonOptionAction}.
+ *
+ * @return the list of atomic option and value tokens
+ * @throws ParseException if there are any problems encountered while
parsing the command line tokens.
+ * @since 1.10.0
+ */
+ public CommandLine parse(final Options options, final String[] arguments,
final Properties properties, final NonOptionAction nonOptionAction)
Review Comment:
If we add an API, this could be an opportunity to simplify call sites to use
variable arguments:
```
public CommandLine parse(final Options options, final Properties properties,
final NonOptionAction nonOptionAction, final String... arguments)
```
WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]