mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
changed tee_usage from being a function to a char[]
that gets used be usage();
This commit is contained in:
parent
9835541c54
commit
a3e0d7928b
@ -21,8 +21,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
#include <stdio.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 _______________________________________________________________ */
|
/* FileList _______________________________________________________________ */
|
||||||
|
|
||||||
@ -80,22 +87,6 @@ tee_fclose(FILE *file, char c)
|
|||||||
fclose(file);
|
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) */
|
/* BusyBoxed tee(1) */
|
||||||
int
|
int
|
||||||
tee_main(int argc, char **argv)
|
tee_main(int argc, char **argv)
|
||||||
@ -117,11 +108,11 @@ tee_main(int argc, char **argv)
|
|||||||
fprintf(stderr, "ingore interrupt not implemented\n");
|
fprintf(stderr, "ingore interrupt not implemented\n");
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
tee_usage();
|
usage(tee_usage);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "tee: invalid option -- %c\n", opt);
|
fprintf(stderr, "tee: invalid option -- %c\n", opt);
|
||||||
tee_usage();
|
usage(tee_usage);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@ -144,4 +135,4 @@ tee_main(int argc, char **argv)
|
|||||||
exit(0);
|
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 $ */
|
||||||
|
31
tee.c
31
tee.c
@ -21,8 +21,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
#include <stdio.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 _______________________________________________________________ */
|
/* FileList _______________________________________________________________ */
|
||||||
|
|
||||||
@ -80,22 +87,6 @@ tee_fclose(FILE *file, char c)
|
|||||||
fclose(file);
|
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) */
|
/* BusyBoxed tee(1) */
|
||||||
int
|
int
|
||||||
tee_main(int argc, char **argv)
|
tee_main(int argc, char **argv)
|
||||||
@ -117,11 +108,11 @@ tee_main(int argc, char **argv)
|
|||||||
fprintf(stderr, "ingore interrupt not implemented\n");
|
fprintf(stderr, "ingore interrupt not implemented\n");
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
tee_usage();
|
usage(tee_usage);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "tee: invalid option -- %c\n", opt);
|
fprintf(stderr, "tee: invalid option -- %c\n", opt);
|
||||||
tee_usage();
|
usage(tee_usage);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@ -144,4 +135,4 @@ tee_main(int argc, char **argv)
|
|||||||
exit(0);
|
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 $ */
|
||||||
|
Loading…
Reference in New Issue
Block a user