[ https://issues.apache.org/jira/browse/CLI-254 ]
Claude Warren deleted comment on CLI-254: ----------------------------------- was (Author: claudenw): The solution was to add a DefaultParser.Builder with the option setStripLeadingAndTrailingQuotes to change the way quotes are handled. > "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: 2h 50m > 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.20.10#820010)