[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] doc: improve the echo and printf help on escapes
From: |
Pádraig Brady |
Subject: |
[PATCH] doc: improve the echo and printf help on escapes |
Date: |
Wed, 28 Oct 2009 11:12:00 +0000 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
* src/printf.c (usage): Merge strings with echo to
aid translators. Move the description for \NNN beside
the other numeric escape codes. Don't mention
"character" as that suggests character conversion.
* src/echo.c (usage): Likewise.
Also mention the \xHH escape sequence.
attached...
cheers,
Pádraig.
>From 24a736d4b205ba915b3fa2916d8b9fc9513ac444 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?P=C3=A1draig=20Brady?= <address@hidden>
Date: Wed, 28 Oct 2009 10:59:05 +0000
Subject: [PATCH] doc: improve the echo and printf help on escapes
* src/printf.c (usage): Merge strings with echo to
aid translators. Move the description for \NNN beside
the other numeric escape codes. Don't mention
"character" as that suggests character conversion.
* src/echo.c (usage): Likewise.
Also mention the \xHH escape sequence.
---
src/echo.c | 9 ++++++---
src/printf.c | 6 ++----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/echo.c b/src/echo.c
index 90b9786..afd722c 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -63,12 +63,11 @@ Echo the STRING(s) to standard output.\n\
\n\
If -e is in effect, the following sequences are recognized:\n\
\n\
- \\0NNN the character whose ASCII code is NNN (octal)\n\
+"), stdout);
+ fputs (_("\
\\\\ backslash\n\
\\a alert (BEL)\n\
\\b backspace\n\
-"), stdout);
- fputs (_("\
\\c produce no further output\n\
\\f form feed\n\
\\n new line\n\
@@ -76,6 +75,10 @@ If -e is in effect, the following sequences are
recognized:\n\
\\t horizontal tab\n\
\\v vertical tab\n\
"), stdout);
+ fputs (_("\
+ \\0NNN byte with octal value NNN (1 to 3 digits)\n\
+ \\xHH byte with hexadecimal value HH (1 to 2 digits)\n\
+"), stdout);
printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
emit_ancillary_info ();
}
diff --git a/src/printf.c b/src/printf.c
index f6f86a5..e9d182a 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -101,22 +101,20 @@ Print ARGUMENT(s) according to FORMAT, or execute
according to OPTION:\n\
FORMAT controls the output as in C printf. Interpreted sequences are:\n\
\n\
\\\" double quote\n\
- \\NNN character with octal value NNN (1 to 3 digits)\n\
- \\\\ backslash\n\
"), stdout);
fputs (_("\
+ \\\\ backslash\n\
\\a alert (BEL)\n\
\\b backspace\n\
\\c produce no further output\n\
\\f form feed\n\
-"), stdout);
- fputs (_("\
\\n new line\n\
\\r carriage return\n\
\\t horizontal tab\n\
\\v vertical tab\n\
"), stdout);
fputs (_("\
+ \\NNN byte with octal value NNN (1 to 3 digits)\n\
\\xHH byte with hexadecimal value HH (1 to 2 digits)\n\
\\uHHHH Unicode (ISO/IEC 10646) character with hex value HHHH (4 digits)\n\
\\UHHHHHHHH Unicode character with hex value HHHHHHHH (8 digits)\n\
--
1.6.2.5
- [PATCH] doc: improve the echo and printf help on escapes,
Pádraig Brady <=