summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/coreutils.texi6
-rw-r--r--src/ls.c4
-rwxr-xr-xtests/misc/ls-misc.pl1
3 files changed, 9 insertions, 2 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 270e6a67a..177379b38 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7676,6 +7676,12 @@ The quoting is suitable for POSIX-compatible shells like
like @command{csh}.
@item shell-always
Quote strings for the shell, even if they would normally not require quoting.
+@item shell-escape
+Like @samp{shell}, but also quoting non-printable characters using the POSIX
+proposed @samp{$''} syntax suitable for most shells.
+@item shell-escape-always
+Like @samp{shell-escape}, but quote strings even if they would
+normally not require quoting.
@item c
Quote strings as for C character string literals, including the
surrounding double-quote characters; this is the same as the
diff --git a/src/ls.c b/src/ls.c
index 95a2ed8ec..8d68a03e1 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4906,8 +4906,8 @@ Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n\
\n\
-Q, --quote-name enclose entry names in double quotes\n\
--quoting-style=WORD use quoting style WORD for entry names:\n\
- literal, locale, shell, shell-always, c, escape\
-\n\
+ literal, locale, shell, shell-always,\n\
+ shell-escape, shell-escape-always, c, escape\n\
"), stdout);
fputs (_("\
-r, --reverse reverse order while sorting\n\
diff --git a/tests/misc/ls-misc.pl b/tests/misc/ls-misc.pl
index 007e25787..8b97c50f0 100755
--- a/tests/misc/ls-misc.pl
+++ b/tests/misc/ls-misc.pl
@@ -136,6 +136,7 @@ my @Tests =
['q-qs-lit', '--quoting=literal', $q_bell, {OUT => "q\a\n"}],
['q-qs-sh', '--quoting=shell', $q_bell, {OUT => "q\a\n"}],
['q-qs-sh-a', '--quoting=shell-always', $q_bell, {OUT => "'q\a'\n"}],
+ ['q-qs-sh-e', '--quoting=shell-escape', $q_bell, {OUT => "'q'\$'\\a'\n"}],
['q-qs-c', '--quoting=c', $q_bell, {OUT => "\"q\\a\"\n"}],
['q-qs-esc', '--quoting=escape', $q_bell, {OUT => "q\\a\n"}],
['q-qs-c-1', '--quoting=c',