aboutsummaryrefslogtreecommitdiff
path: root/coreutils/tail.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-05-12 19:41:47 +0000
committerErik Andersen <andersen@codepoet.org>2000-05-12 19:41:47 +0000
commit7ab9c7ee52db8759d457819f5480378fa3aa97cc (patch)
tree37ef0fb8b142a4925b866c7caa5207b71b4ecae6 /coreutils/tail.c
parent3d427ac5efd249dc25dd03deb30520335f68911a (diff)
downloadbusybox-7ab9c7ee52db8759d457819f5480378fa3aa97cc.tar.gz
Lots of updates. Finished implementing BB_FEATURE_TRIVIAL_HELP
which lets you compile out most of the "--help" output, saving up to 17k. Renamed mnc to nc. -Erik
Diffstat (limited to 'coreutils/tail.c')
-rw-r--r--coreutils/tail.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 321c5c4b2..3b3e2f56c 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -47,6 +47,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
+#define BB_DECLARE_EXTERN
+#define bb_need_help
+#include "messages.c"
#define XWRITE(fd, buffer, n_bytes) \
@@ -70,15 +73,18 @@ static int forever;
static int print_headers;
const char tail_usage[] =
- "tail [OPTION] [FILE]...\n\n"
- "Print last 10 lines of each FILE to standard output.\n"
+ "tail [OPTION] [FILE]...\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+ "\nPrint last 10 lines of each FILE to standard output.\n"
"With more than one FILE, precede each with a header giving the\n"
"file name. With no FILE, or when FILE is -, read standard input.\n\n"
"Options:\n"
"\t-n NUM\t\tPrint last NUM lines instead of first 10\n"
"\t-f\t\tOutput data as the file grows. This version\n"
- "\t\t\tof 'tail -f' supports only one file at a time.\n";
+ "\t\t\tof 'tail -f' supports only one file at a time.\n"
+#endif
+ ;
static void write_header(const char *filename)
@@ -512,9 +518,9 @@ char *program_name;
static int have_read_stdin;
-static const char tail_usage[] = "tail [OPTION]... [FILE]...\n\
-\n\
-Print last 10 lines of each FILE to standard output.\n\
+static const char tail_usage[] = "tail [OPTION]... [FILE]...\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+"\nPrint last 10 lines of each FILE to standard output.\n\
With more than one FILE, precede each with a header giving the file name.\n\
With no FILE, or when FILE is -, read standard input.\n\
\n\
@@ -523,11 +529,12 @@ With no FILE, or when FILE is -, read standard input.\n\
-n=N output the last N lines, instead of last 10\n\
-q never output headers giving file names\n\
-v always output headers giving file names\n\
- --help display this help and exit\n\
\n\
If the first character of N (bytes or lines) is a `+', output begins with \n\
the Nth item from the start of each file, otherwise, print the last N items\n\
-in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n\n";
+in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n"
+#endif
+;
static void write_header(const char *filename, const char *comment)
{