diff options
author | Jim Meyering <jim@meyering.net> | 1993-10-17 03:57:04 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1993-10-17 03:57:04 +0000 |
commit | fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8 (patch) | |
tree | ffc67e10bcf805a9ee5b8243a5103f5bdb4fb90a /src/tee.c | |
parent | 6e1a4cca6862fa1fb40b4c38b73fa30ebb61344b (diff) | |
download | coreutils-fa7a1e19e2b4fcec1f67ebd75f6f12ae65eef8c8.tar.xz |
merge with 1.8.1g
Diffstat (limited to 'src/tee.c')
-rw-r--r-- | src/tee.c | 31 |
1 files changed, 23 insertions, 8 deletions
@@ -67,13 +67,28 @@ static struct option const long_options[] = }; static void -usage () +usage (status) + int status; { - fprintf (stderr, "\ -Usage: %s [{--help,--version}] [-ai] [--append]\n\ - [--ignore-interrupts] [file...]\n", - program_name); - exit (1); + fprintf (status == 0 ? stdout : stderr, "\ +Usage: %s [OPTION]... [FILE]...\n\ +", + program_name); + + if (status != 0) + fprintf (stderr, "\nTry `%s --help' for more information.\n", + program_name); + else + + printf ("\ +\n\ + -a, --append append to the given FILEs, do not overwrite\n\ + -i, --ignore-interrupts ignore interrupt signals\n\ + --help display this help and exit\n\ + --version output version information and exit\n\ +"); + + exit (status); } void @@ -105,7 +120,7 @@ main (argc, argv) break; default: - usage (); + usage (1); } } @@ -116,7 +131,7 @@ main (argc, argv) } if (show_help) - usage (); + usage (0); if (ignore_interrupts) { |