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
If a config object specified via the .config option to yargs contains a value that starts and ends with quotes, yargs strips those quotes, due to this code here:
I would suggest that when parsing already-split arguments, e.g. from process.argv, or when processing a config file, quotes should never be stripped, and no additional splitting should ever occur. The only time stripping of quotes should happen is when parsing an unsplit string. In that case, the string should be parsed into an array of strings using shell-style parsing, and then parsing should proceed using the resultant array, and do no further splitting or quote handling.
The text was updated successfully, but these errors were encountered:
Are there any news how to solve this?
I have a quite similar issue - via the config method I am reading a JSON file, which has some properties with dashes, for e.g. "X-MyPropety": "1",
If a config object specified via the
.config
option to yargs contains a value that starts and ends with quotes, yargs strips those quotes, due to this code here:yargs-parser/lib/yargs-parser.ts
Line 608 in 50b54ae
That seems like confusing, and undesirable behavior, and makes it difficult to pass values containing embedded quotes.
For example:
This prints:
But I would expect it to instead print:
I would suggest that when parsing already-split arguments, e.g. from process.argv, or when processing a config file, quotes should never be stripped, and no additional splitting should ever occur. The only time stripping of quotes should happen is when parsing an unsplit string. In that case, the string should be parsed into an array of strings using shell-style parsing, and then parsing should proceed using the resultant array, and do no further splitting or quote handling.
The text was updated successfully, but these errors were encountered: