summaryrefslogtreecommitdiff
path: root/src/echo.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-10-17 03:57:04 +0000
committerJim Meyering <jim@meyering.net>1993-10-17 03:57:04 +0000
commitfa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8 (patch)
treeffc67e10bcf805a9ee5b8243a5103f5bdb4fb90a /src/echo.c
parent6e1a4cca6862fa1fb40b4c38b73fa30ebb61344b (diff)
downloadcoreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.tar.xz
merge with 1.8.1g
Diffstat (limited to 'src/echo.c')
-rw-r--r--src/echo.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/echo.c b/src/echo.c
index ab0779eae..6c514fc8c 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -74,11 +74,42 @@ char *program_name;
void parse_long_options ();
static void
-usage ()
+usage (status)
+ int status;
{
- fprintf (stderr, "Usage: %s [{--help,--version}] [-ne] [string ...]\n",
+ fprintf (status == 0 ? stdout : stderr, "\
+Usage: %s [OPTION]... [STRING]...\n\
+",
program_name);
- exit (1);
+
+ if (status != 0)
+ fprintf (stderr, "\nTry `%s --help' for more information.\n",
+ program_name);
+ else
+
+ printf ("\
+\n\
+ -n do not output the trailing newline\n\
+ -e (unused)\n\
+ -E disable interpolation of some sequences in STRINGs\n\
+ --help display this help and exit (should be alone)\n\
+ --version output version information and exit (should be alone)\n\
+\n\
+Without -E, the following sequences are recognized and interpolated:\n\
+\n\
+ \\NNN the character whose ASCII code is NNN (octal)\n\
+ \\\\ backslash\n\
+ \\a alert (BEL)\n\
+ \\b backspace\n\
+ \\c suppress trailing newline\n\
+ \\f form feed\n\
+ \\n new line\n\
+ \\r carriage return\n\
+ \\t horizontal tab\n\
+ \\v vertical tab\n\
+");
+
+ exit (status);
}
/* Print the words in LIST to standard output. If the first word is