Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.4.0
-
None
-
None
-
$ 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.$ 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.
Description
$ 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" $
$ 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
$ 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
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.
Attachments
Issue Links
- requires
-
CLI-254 "test" gets parsed as test, quotes die :-(
- Resolved