groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Schumacher (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-7352) CliBuilder kills head/tail quotes from argument
Date Tue, 02 Jun 2015 17:37:50 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-7352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Pascal Schumacher updated GROOVY-7352:
--------------------------------------
    Component/s:     (was: groovy-runtime)
                 command line processing

> CliBuilder kills head/tail quotes from argument
> -----------------------------------------------
>
>                 Key: GROOVY-7352
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7352
>             Project: Groovy
>          Issue Type: Bug
>          Components: command line processing
>    Affects Versions: 2.4.0
>         Environment: $ groovy -v
> Groovy Version: 2.4.0 JVM: 1.8.0_31 Vendor: Oracle Corporation OS: Linux
> apostrophes works as expected:
> $ groovy bug-paf-2.groovy -f "'test'"
> 'test'
> $ groovy bug-paf-2.groovy -f "'test"
> 'test
> $ groovy bug-paf-2.groovy -f "test'"
> test'
> (problem is only with quotes inside argument value)
> I wanted to pass json filter expression -f ".Field == \"\""
> and got last quote killed.
>            Reporter: Alexander Petrossian (PAF)
>
> {code}
> $ cat bug-paf-2.groovy
> def cli = new CliBuilder()
> cli.with {
> 	f longOpt:'json-filter','jq expression', args: 1
> }
> def opt = cli.parse(args)
> print "${opt.f}\n"
> $ 
> {code}
> {noformat}
> $ groovy bug-paf-2.groovy -f '"test"'  #expected "test", got:
> test
> $ groovy bug-paf-2.groovy -f '"test'  #expected "test, got:
> test
> $ groovy bug-paf-2.groovy -f 'test"' #expected test", got:
> test
> {noformat}
> {noformat}
> $ groovy bug-paf-2.groovy -f "\"test\""  #expected "test", got:
> test
> $ groovy bug-paf-2.groovy -f "\"test"  #expected "test, got:
> test
> $ groovy bug-paf-2.groovy -f "test\"" #expected test", got:
> test
> {noformat}
> looks like somebody clears head/tail quotes.
> this must not be done.
> removing quotes/apostrophes is a task for shell, once data gets to argv, no unquoting
must be done on it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message