-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nested quoting #595
Comments
I tried to pass multiple
Is this the same scenario as the one you've described above? |
Ah sorry. My bad. Should escape the space as well. |
@pubudu91 Was there any problem with your example, or did it behave as expected? To explain what I had in mind with nested quotes, assume we have a positional parameter defined like this:
the parameter values will first be split by the specified regular expression (
Given the above input, if
After that, each value is parsed as a KEY=VALUE pair and put into the map. We want the parser to recognize For this to work, the current quote-parsing logic needs to be extended to recognize single quotes as well as double quotes, and recognize nested quoted sections. That is what this ticket is about. |
@pubudu91 in your example, why do you need to escape the double quotes? Don't you want to do this instead?
|
If not escaped, the quotes seem to get trimmed. Checked the |
You can control quote trimming with |
Yes, probably. As I said, it's not an issue with picocli. |
Adding this ticket to the 4.0 roadmap: As part of the work for #738, picocli 4.0 will fully support nested backslash-escaped double quotes. Single quotes will not have any special meaning. |
As an enhancement to #594, we can support nested quotes.
For example, when splitting on the
","
split regex, with aMap
option whose keys have embedded'='
characters, we want to be able to parse input like this:Giving a map with key-value pairs like this:
The text was updated successfully, but these errors were encountered: