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

Gary D. Gregory commented on CLI-254:
-------------------------------------

I think the default behavior is correct, for example {{--file "a/path to/file 
with spaces.txt"}} should give me the String {{a/path to/file with spaces.txt}} 
and _not_ {{"a/path to/file with spaces.txt"}}.

I am OK with adding a ParserBuilder so we do not start growing constructors on 
the parser. This could also be a per-option flag since we already have 
{{Option.Builder}}.

> "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)

Reply via email to