aboutsummaryrefslogtreecommitdiff
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
parent9835541c540a5009c13655f72eb7465c5dbd854b (diff)
downloadbusybox-w32-a3e0d7928b0042dfe1be94da62b750664306b404.tar.gz
busybox-w32-a3e0d7928b0042dfe1be94da62b750664306b404.tar.bz2
busybox-w32-a3e0d7928b0042dfe1be94da62b750664306b404.zip
changed tee_usage from being a function to a char[]
that gets used be usage();
-rw-r--r--coreutils/tee.c31
-rw-r--r--tee.c31
2 files changed, 22 insertions, 40 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 @@
21 * 21 *
22 */ 22 */
23 23
24#include "internal.h"
24#include <stdio.h> 25#include <stdio.h>
25#include <stdlib.h> 26
27static const char tee_usage[] =
28"Usage: tee [OPTION]... [FILE]...\n"
29"Copy standard input to each FILE, and also to standard output.\n\n"
30" -a, append to the given FILEs, do not overwrite\n"
31" -i, ignore interrupt signals\n"
32" -h, this help message\n";
26 33
27/* FileList _______________________________________________________________ */ 34/* FileList _______________________________________________________________ */
28 35
@@ -80,22 +87,6 @@ tee_fclose(FILE *file, char c)
80 fclose(file); 87 fclose(file);
81} 88}
82 89
83/* help message */
84static void
85tee_usage()
86{
87 fprintf (
88 stdout,
89 "%s\n%s\n%s\n%s\n%s\n",
90 "Usage: tee [OPTION]... [FILE]...",
91 "Copy standard input to each FILE, and also to standard output.\n",
92 " -a, append to the given FILEs, do not overwrite",
93 " -i, ignore interrupt signals",
94 " -h, this help message"
95 );
96 exit(1);
97}
98
99/* BusyBoxed tee(1) */ 90/* BusyBoxed tee(1) */
100int 91int
101tee_main(int argc, char **argv) 92tee_main(int argc, char **argv)
@@ -117,11 +108,11 @@ tee_main(int argc, char **argv)
117 fprintf(stderr, "ingore interrupt not implemented\n"); 108 fprintf(stderr, "ingore interrupt not implemented\n");
118 break; 109 break;
119 case 'h': 110 case 'h':
120 tee_usage(); 111 usage(tee_usage);
121 break; 112 break;
122 default: 113 default:
123 fprintf(stderr, "tee: invalid option -- %c\n", opt); 114 fprintf(stderr, "tee: invalid option -- %c\n", opt);
124 tee_usage(); 115 usage(tee_usage);
125 } 116 }
126 } else { 117 } else {
127 break; 118 break;
@@ -144,4 +135,4 @@ tee_main(int argc, char **argv)
144 exit(0); 135 exit(0);
145} 136}
146 137
147/* $Id: tee.c,v 1.2 1999/12/10 06:45:42 andersen Exp $ */ 138/* $Id: tee.c,v 1.3 1999/12/10 07:41:03 beppu Exp $ */
diff --git a/tee.c b/tee.c
index e231efd54..45128b568 100644
--- a/tee.c
+++ b/tee.c
@@ -21,8 +21,15 @@
21 * 21 *
22 */ 22 */
23 23
24#include "internal.h"
24#include <stdio.h> 25#include <stdio.h>
25#include <stdlib.h> 26
27static const char tee_usage[] =
28"Usage: tee [OPTION]... [FILE]...\n"
29"Copy standard input to each FILE, and also to standard output.\n\n"
30" -a, append to the given FILEs, do not overwrite\n"
31" -i, ignore interrupt signals\n"
32" -h, this help message\n";
26 33
27/* FileList _______________________________________________________________ */ 34/* FileList _______________________________________________________________ */
28 35
@@ -80,22 +87,6 @@ tee_fclose(FILE *file, char c)
80 fclose(file); 87 fclose(file);
81} 88}
82 89
83/* help message */
84static void
85tee_usage()
86{
87 fprintf (
88 stdout,
89 "%s\n%s\n%s\n%s\n%s\n",
90 "Usage: tee [OPTION]... [FILE]...",
91 "Copy standard input to each FILE, and also to standard output.\n",
92 " -a, append to the given FILEs, do not overwrite",
93 " -i, ignore interrupt signals",
94 " -h, this help message"
95 );
96 exit(1);
97}
98
99/* BusyBoxed tee(1) */ 90/* BusyBoxed tee(1) */
100int 91int
101tee_main(int argc, char **argv) 92tee_main(int argc, char **argv)
@@ -117,11 +108,11 @@ tee_main(int argc, char **argv)
117 fprintf(stderr, "ingore interrupt not implemented\n"); 108 fprintf(stderr, "ingore interrupt not implemented\n");
118 break; 109 break;
119 case 'h': 110 case 'h':
120 tee_usage(); 111 usage(tee_usage);
121 break; 112 break;
122 default: 113 default:
123 fprintf(stderr, "tee: invalid option -- %c\n", opt); 114 fprintf(stderr, "tee: invalid option -- %c\n", opt);
124 tee_usage(); 115 usage(tee_usage);
125 } 116 }
126 } else { 117 } else {
127 break; 118 break;
@@ -144,4 +135,4 @@ tee_main(int argc, char **argv)
144 exit(0); 135 exit(0);
145} 136}
146 137
147/* $Id: tee.c,v 1.2 1999/12/10 06:45:42 andersen Exp $ */ 138/* $Id: tee.c,v 1.3 1999/12/10 07:41:03 beppu Exp $ */