basic/escape: add mode where empty arguments are still shown as ""

For variables, FOO= is OK. But when quoting positional arguments, we want to
use something with quotes ("", '', or even $'') for an empty string.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-05-05 12:12:10 +02:00
parent 9e53c10a0f
commit 1129cd8a71
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -38,6 +38,7 @@ typedef enum ShellEscapeFlags {
* Tabs and newlines are escaped. */
SHELL_ESCAPE_POSIX = 1 << 1, /* Use POSIX shell escape syntax (a string enclosed in $'') instead of plain quotes. */
SHELL_ESCAPE_EMPTY = 1 << 2, /* Format empty arguments as "". */
} ShellEscapeFlags;
char* cescape(const char *s);