[ https://issues.apache.org/jira/browse/CLI-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17425571#comment-17425571 ]
Istvan Toth commented on CLI-254: --------------------------------- The shell will already process and remove the quotes in your example, so the program never sees them. The library currently strips the quotes even if you jump through hoops to preserve them, i.e. --file '"a/path to/file with spaces.txt"' I agree on not complicating the constructor. I'm going to refactor the PR to add a ParserBuilder, hopefully soon. > "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: 40m > 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)