From 2f99a8270019db845dfebbd587efc290fc87e689 Mon Sep 17 00:00:00 2001 From: Grant Hutchins Date: Sun, 29 Dec 2024 11:16:22 -0600 Subject: [PATCH] Improve documentation for `string escape` Before, it unnecessarily stated that there are three `--style` options, when there are actually four. I also align the default `--style=script` argument to the beginning of the line to match the other options visually for easier scanning. --- doc_src/cmds/string-escape.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc_src/cmds/string-escape.rst b/doc_src/cmds/string-escape.rst index ba9bc250b..ec83e4424 100644 --- a/doc_src/cmds/string-escape.rst +++ b/doc_src/cmds/string-escape.rst @@ -18,7 +18,9 @@ Description .. BEGIN DESCRIPTION -``string escape`` escapes each *STRING* in one of three ways. The first is **--style=script**. This is the default. It alters the string such that it can be passed back to ``eval`` to produce the original argument again. By default, all special characters are escaped, and quotes are used to simplify the output when possible. If **-n** or **--no-quoted** is given, the simplifying quoted format is not used. Exit status: 0 if at least one string was escaped, or 1 otherwise. +``string escape`` escapes each *STRING* in one of several ways. + +**--style=script** (default) alters the string such that it can be passed back to ``eval`` to produce the original argument again. By default, all special characters are escaped, and quotes are used to simplify the output when possible. If **-n** or **--no-quoted** is given, the simplifying quoted format is not used. Exit status: 0 if at least one string was escaped, or 1 otherwise. **--style=var** ensures the string can be used as a variable name by hex encoding any non-alphanumeric characters. The string is first converted to UTF-8 before being encoded.