-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi, thanks for the great library!
I've noticed that some strings are unnecessarily quoted for ANSI-C escape sequences. This seems to happen on strings that contain an equal sign. For example, the string --arg=var will be quoted as $'--arg=var'. This is valid and doesn't cause any issues, but it does appear to be unnecessary.
I wasn't familiar with this style of quoting. It is covered in the bash docs here:
3.1.2.4 ANSI-C Quoting
Character sequences of the form $’string’ are treated as a special kind of single quotes. The sequence expands to string, with backslash-escaped characters in string replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows:
\a
alert (bell)\b
backspace
...
The expanded result is single-quoted, as if the dollar sign had not been present.
(source)