emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51311: closed ([PATCH] echo: update --help to document edge cases)


From: GNU bug Tracking System
Subject: bug#51311: closed ([PATCH] echo: update --help to document edge cases)
Date: Thu, 21 Oct 2021 12:12:02 +0000

Your message dated Thu, 21 Oct 2021 13:11:25 +0100
with message-id <a0798791-704f-3032-da2a-7cb9480904ef@draigBrady.com>
and subject line Re: bug#51311: [PATCH] echo: update --help to document edge 
cases
has caused the debbugs.gnu.org bug report #51311,
regarding [PATCH] echo: update --help to document edge cases
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
51311: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=51311
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] echo: update --help to document edge cases Date: Wed, 20 Oct 2021 23:50:47 +0200
* src/echo.c (usage): Document edge cases when displaying arbitrary
strings with the echo command.
---
 src/echo.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/echo.c b/src/echo.c
index 18513398a..73b44660b 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -78,6 +78,14 @@ If -e is in effect, the following sequences are 
recognized:\n\
   fputs (_("\
   \\0NNN   byte with octal value NNN (1 to 3 digits)\n\
   \\xHH    byte with hexadecimal value HH (1 to 2 digits)\n\
+"), stdout);
+  fputs (_("\
+\n\
+NOTE: The echo command doesn't behave gracefully when displaying\n\
+arbitrary strings. For example, it can't display the string \"-n\" and\n\
+requires the STRICTLY_POSIX flag to display \"-e\" or \"-E\". Therefore,\n\
+if you need to display arbitrary strings please use the printf command\n\
+instead.\n\
 "), stdout);
   printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
   emit_ancillary_info (PROGRAM_NAME);
-- 
2.25.1



--- End Message ---
--- Begin Message --- Subject: Re: bug#51311: [PATCH] echo: update --help to document edge cases Date: Thu, 21 Oct 2021 13:11:25 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0
On 20/10/2021 22:50, Florent Flament wrote:

* src/echo.c (usage): Document edge cases when displaying arbitrary
strings with the echo command.
---
  src/echo.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/src/echo.c b/src/echo.c
index 18513398a..73b44660b 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -78,6 +78,14 @@ If -e is in effect, the following sequences are 
recognized:\n\
    fputs (_("\
    \\0NNN   byte with octal value NNN (1 to 3 digits)\n\
    \\xHH    byte with hexadecimal value HH (1 to 2 digits)\n\
+"), stdout);
+  fputs (_("\
+\n\
+NOTE: The echo command doesn't behave gracefully when displaying\n\
+arbitrary strings. For example, it can't display the string \"-n\" and\n\
+requires the STRICTLY_POSIX flag to display \"-e\" or \"-E\". Therefore,\n\
+if you need to display arbitrary strings please use the printf command\n\
+instead.\n\
  "), stdout);
    printf (USAGE_BUILTIN_WARNING, PROGRAM_NAME);
    emit_ancillary_info (PROGRAM_NAME);

This is too verbose.
BTW the env var is POSIXLY_CORRECT, not STRICTLY_POSIX.
Anyway I don't think we should mention that in the man page anyway.
I'll push the attached later, which just says printf(1) is preferred.

cheers,
Pádraig

Attachment: echo-printf.patch
Description: Text Data


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]