diff options
author | Jim Meyering <jim@meyering.net> | 1993-10-23 15:37:19 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1993-10-23 15:37:19 +0000 |
commit | b869639f4661488eba0bb2d08020c6e71bb72627 (patch) | |
tree | e325845ec7ca06b4d59fcc07e87020897c7c4d9b /src/tac.c | |
parent | d1df8c198d8878b77d1d1583bc7b3c491534616a (diff) | |
download | coreutils-b869639f4661488eba0bb2d08020c6e71bb72627.tar.xz |
merge with 1.8d+
Diffstat (limited to 'src/tac.c')
-rw-r--r-- | src/tac.c | 33 |
1 files changed, 25 insertions, 8 deletions
@@ -130,13 +130,30 @@ static struct option const longopts[] = }; static void -usage () +usage (status) + int status; { - fprintf (stderr, "\ -Usage: %s [-br] [-s separator] [--before] [--regex] [--separator=separator]\n\ - [--help] [--version] [file...]\n", - program_name); - exit (1); + 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, --before attach the separator before instead of after\n\ + -r, --regex intepret the separator as a regular expression\n\ + -s, --separator STRING use STRING as the separator instead of newline\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); } void @@ -173,7 +190,7 @@ main (argc, argv) error (1, 0, "separator cannot be empty"); break; default: - usage (); + usage (1); } } @@ -184,7 +201,7 @@ main (argc, argv) } if (show_help) - usage (); + usage (0); if (sentinel_length == 0) { |