[ https://issues.apache.org/jira/browse/CLI-254?focusedWorklogId=663894&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-663894 ]
ASF GitHub Bot logged work on CLI-254: -------------------------------------- Author: ASF GitHub Bot Created on: 12/Oct/21 06:34 Start Date: 12/Oct/21 06:34 Worklog Time Spent: 10m Work Description: stoty commented on a change in pull request #58: URL: https://github.com/apache/commons-cli/pull/58#discussion_r726801420 ########## File path: src/main/java/org/apache/commons/cli/DefaultParser.java ########## @@ -101,6 +105,20 @@ public DefaultParser() { */ public DefaultParser(final boolean allowPartialMatching) { this.allowPartialMatching = allowPartialMatching; + this.stripLeadingAndTrailingQuotes = true; + } + + /** + * Create a new DefaultParser instance with the specified partial matching and quote Review comment: Done ########## File path: src/main/java/org/apache/commons/cli/DefaultParser.java ########## @@ -625,4 +643,119 @@ private void updateRequiredOptions(final Option option) throws AlreadySelectedEx group.setSelected(option); } } + + /** + * Strip balanced leading and trailing quotes if the stripLeadingAndTrailingQuotes is set + * + * @param token a string + * @return token with the quotes stripped (if set) + */ Review comment: Private is fine. -- 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: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 663894) Time Spent: 1h 20m (was: 1h 10m) > "test" gets parsed as test, quotes die :-( > ------------------------------------------ > > Key: CLI-254 > URL: https://issues.apache.org/jira/browse/CLI-254 > Project: Commons CLI > Issue Type: Bug > Affects Versions: 1.3 > Reporter: Alexander Petrossian (PAF) > Priority: Major > Time Spent: 1h 20m > Remaining Estimate: 0h > > {code} > def cli = new CliBuilder() > cli.with { > f longOpt:'json-filter','jq expression', args: 1 > } > def vals = ['test', 't"es"t', > "'test", "test'", "'test'", > '"test', 'test"', '"test"'] > vals.each { > def opt = cli.parse(['-f', it]) > assert opt.f == it > } > {code} > It fails on last entry: "test". -- This message was sent by Atlassian Jira (v8.3.4#803005)