You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Trailing and leading quote characters are removed #201
Trailing and leading quote characters are removed from the values. If I want to pass a 'string' as a value I need to triple-quote it as "''string''" or \'''string\''' when I'm specifying that in the shell.
This probably relates to #138, #180. Definitely relates to #145 and #153.
I would suggest introducing a new keepQuotes/trimQuotes option to support the all edge cases.
Activity
[-]Question about quoting again[/-][+]Trailing and leading quote characters are removed[/+]bcoe commentedon Sep 6, 2019
@mefcorvi in an ideal world
my-app --argument \"foo\"would work, might be worth rethinking this bit of the parser.juergba commentedon Oct 31, 2019
We should distinguish between parsing a
stringorarray.array:require('yargs-parser')([ '--arg', '"option"' ]):we should not remove any double quotes =>
{ _: [], arg: '"option"' }string:require('yargs-parser')( '--arg "option"' ):to be discussed, IMO double quotes should be removed unless:
So the change would have to be done in "tokenize-arg-string.js", and not in our parser.
shadowspawn commentedon Mar 12, 2023
Thanks for the report, and the simple reproduction.
I can no longer reproduce the reported issue. I suspect it was fixed by #407.