You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Istvan Toth (Jira)" <ji...@apache.org> on 2021/01/29 10:04:00 UTC

[jira] [Commented] (CLI-254) "test" gets parsed as test, quotes die :-(

    [ https://issues.apache.org/jira/browse/CLI-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17274281#comment-17274281 ] 

Istvan Toth commented on CLI-254:
---------------------------------

I propose the fix in 
https://github.com/apache/commons-cli/pull/58
, which adds a new constructor option to make sure we don't break code that depends on the existing implementation.

> "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: 10m
>  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)