aboutsummaryrefslogtreecommitdiff
path: root/coreutils/tee.c
diff options
context:
space:
mode:
authorJohn Beppu <beppu@lbox.org>1999-12-10 07:41:03 +0000
committerJohn Beppu <beppu@lbox.org>1999-12-10 07:41:03 +0000
commita3e0d7928b0042dfe1be94da62b750664306b404 (patch)
treee238a76580cca17adca35b3e83a30e514b2cddc8 /coreutils/tee.c
parent9835541c540a5009c13655f72eb7465c5dbd854b (diff)
downloadbusybox-a3e0d7928b0042dfe1be94da62b750664306b404.tar.gz
changed tee_usage from being a function to a char[]
that gets used be usage();
Diffstat (limited to 'coreutils/tee.c')
-rw-r--r--coreutils/tee.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/coreutils/tee.c b/coreutils/tee.c
index e231efd54..45128b568 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -21,8 +21,15 @@
*
*/
+#include "internal.h"
#include <stdio.h>
-#include <stdlib.h>
+
+static const char tee_usage[] =
+"Usage: tee [OPTION]... [FILE]...\n"
+"Copy standard input to each FILE, and also to standard output.\n\n"
+" -a, append to the given FILEs, do not overwrite\n"
+" -i, ignore interrupt signals\n"
+" -h, this help message\n";
/* FileList _______________________________________________________________ */
@@ -80,22 +87,6 @@ tee_fclose(FILE *file, char c)
fclose(file);
}
-/* help message */
-static void
-tee_usage()
-{
- fprintf (
- stdout,
- "%s\n%s\n%s\n%s\n%s\n",
- "Usage: tee [OPTION]... [FILE]...",
- "Copy standard input to each FILE, and also to standard output.\n",
- " -a, append to the given FILEs, do not overwrite",
- " -i, ignore interrupt signals",
- " -h, this help message"
- );
- exit(1);
-}
-
/* BusyBoxed tee(1) */
int
tee_main(int argc, char **argv)
@@ -117,11 +108,11 @@ tee_main(int argc, char **argv)
fprintf(stderr, "ingore interrupt not implemented\n");
break;
case 'h':
- tee_usage();
+ usage(tee_usage);
break;
default:
fprintf(stderr, "tee: invalid option -- %c\n", opt);
- tee_usage();
+ usage(tee_usage);
}
} else {
break;
@@ -144,4 +135,4 @@ tee_main(int argc, char **argv)
exit(0);
}
-/* $Id: tee.c,v 1.2 1999/12/10 06:45:42 andersen Exp $ */
+/* $Id: tee.c,v 1.3 1999/12/10 07:41:03 beppu Exp $ */