-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
When I call a Nim program like this: ./main -i "a\"b\"c" and use the parseopt module to parse the arguments, instead of getting the string a"b"c, I get abc, and if I use spaces,
instead of a " b " c, I get a, b and c.
The problem is in /lib/pure/parseopt.nim in parseWord, at the line 45. The procedure is not considering any escape sequence starting with \, it just keeps going until it finds another ", even if it's escaped.
After looking a little more, I found that using parseopt2 solves the problem, by using a list of arguments instead of a concatenated command, but then why is the broken version still in the standard library and is not deprecated?