summaryrefslogtreecommitdiff
path: root/src/cat.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-10-23 15:37:19 +0000
committerJim Meyering <jim@meyering.net>1993-10-23 15:37:19 +0000
commitb869639f4661488eba0bb2d08020c6e71bb72627 (patch)
treee325845ec7ca06b4d59fcc07e87020897c7c4d9b /src/cat.c
parentd1df8c198d8878b77d1d1583bc7b3c491534616a (diff)
downloadcoreutils-b869639f4661488eba0bb2d08020c6e71bb72627.tar.xz
merge with 1.8d+
Diffstat (limited to 'src/cat.c')
-rw-r--r--src/cat.c42
1 files changed, 32 insertions, 10 deletions
diff --git a/src/cat.c b/src/cat.c
index 8cbc61f7d..702d5c984 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -85,15 +85,37 @@ static int newlines2 = 0;
static int exit_stat = 0;
static void
-usage ()
+usage (status)
+ int status;
{
- fprintf (stderr, "\
-Usage: %s [-benstuvAET] [--number] [--number-nonblank] [--squeeze-blank]\n\
- [--show-nonprinting] [--show-ends] [--show-tabs] [--show-all]\n\
- [--help] [--version] [file...]\n",
- program_name);
-
- exit (2);
+ if (status != 0)
+ fprintf (stderr, "Try `%s --help' for more information.\n",
+ program_name);
+ else
+ {
+ printf ("\
+Usage: %s [OPTION] [FILE]...\n\
+",
+ program_name);
+ printf ("\
+\n\
+ -b, --number-nonblank number nonblank output lines\n\
+ -e equivalent to -vE\n\
+ -n, --number number all output lines\n\
+ -s, --squeeze-blank never more than one single blank line\n\
+ -t equivalent to -vT\n\
+ -u (ignored)\n\
+ -v, --show-nonprinting use ^ and M- notation, save for LFD and TAB\n\
+ -A, --show-all equivalent to -vET\n\
+ -E, --show-ends display $ at end of each line\n\
+ -T, --show-tabs display TAB characters as ^I\n\
+ --help display this help and exit\n\
+ --version output version information and exit\n\
+\n\
+With no FILE, or when FILE is -, read standard input.\n\
+");
+ }
+ exit (status);
}
@@ -231,7 +253,7 @@ main (argc, argv)
break;
default:
- usage ();
+ usage (2);
}
}
@@ -242,7 +264,7 @@ main (argc, argv)
}
if (show_help)
- usage ();
+ usage (0);
output_desc = 1;