diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-05-12 19:41:47 +0000 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-05-12 19:41:47 +0000 |
commit | 7ab9c7ee52db8759d457819f5480378fa3aa97cc (patch) | |
tree | 37ef0fb8b142a4925b866c7caa5207b71b4ecae6 /coreutils/tail.c | |
parent | 3d427ac5efd249dc25dd03deb30520335f68911a (diff) | |
download | busybox-w32-7ab9c7ee52db8759d457819f5480378fa3aa97cc.tar.gz busybox-w32-7ab9c7ee52db8759d457819f5480378fa3aa97cc.tar.bz2 busybox-w32-7ab9c7ee52db8759d457819f5480378fa3aa97cc.zip |
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.c | 23 |
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 @@ | |||
47 | #include <sys/stat.h> | 47 | #include <sys/stat.h> |
48 | #include <fcntl.h> | 48 | #include <fcntl.h> |
49 | #include <ctype.h> | 49 | #include <ctype.h> |
50 | #define BB_DECLARE_EXTERN | ||
51 | #define bb_need_help | ||
52 | #include "messages.c" | ||
50 | 53 | ||
51 | 54 | ||
52 | #define XWRITE(fd, buffer, n_bytes) \ | 55 | #define XWRITE(fd, buffer, n_bytes) \ |
@@ -70,15 +73,18 @@ static int forever; | |||
70 | static int print_headers; | 73 | static int print_headers; |
71 | 74 | ||
72 | const char tail_usage[] = | 75 | const char tail_usage[] = |
73 | "tail [OPTION] [FILE]...\n\n" | 76 | "tail [OPTION] [FILE]...\n" |
74 | "Print last 10 lines of each FILE to standard output.\n" | 77 | #ifndef BB_FEATURE_TRIVIAL_HELP |
78 | "\nPrint last 10 lines of each FILE to standard output.\n" | ||
75 | "With more than one FILE, precede each with a header giving the\n" | 79 | "With more than one FILE, precede each with a header giving the\n" |
76 | "file name. With no FILE, or when FILE is -, read standard input.\n\n" | 80 | "file name. With no FILE, or when FILE is -, read standard input.\n\n" |
77 | "Options:\n" | 81 | "Options:\n" |
78 | "\t-n NUM\t\tPrint last NUM lines instead of first 10\n" | 82 | "\t-n NUM\t\tPrint last NUM lines instead of first 10\n" |
79 | 83 | ||
80 | "\t-f\t\tOutput data as the file grows. This version\n" | 84 | "\t-f\t\tOutput data as the file grows. This version\n" |
81 | "\t\t\tof 'tail -f' supports only one file at a time.\n"; | 85 | "\t\t\tof 'tail -f' supports only one file at a time.\n" |
86 | #endif | ||
87 | ; | ||
82 | 88 | ||
83 | 89 | ||
84 | static void write_header(const char *filename) | 90 | static void write_header(const char *filename) |
@@ -512,9 +518,9 @@ char *program_name; | |||
512 | static int have_read_stdin; | 518 | static int have_read_stdin; |
513 | 519 | ||
514 | 520 | ||
515 | static const char tail_usage[] = "tail [OPTION]... [FILE]...\n\ | 521 | static const char tail_usage[] = "tail [OPTION]... [FILE]...\n" |
516 | \n\ | 522 | #ifndef BB_FEATURE_TRIVIAL_HELP |
517 | Print last 10 lines of each FILE to standard output.\n\ | 523 | "\nPrint last 10 lines of each FILE to standard output.\n\ |
518 | With more than one FILE, precede each with a header giving the file name.\n\ | 524 | With more than one FILE, precede each with a header giving the file name.\n\ |
519 | With no FILE, or when FILE is -, read standard input.\n\ | 525 | With no FILE, or when FILE is -, read standard input.\n\ |
520 | \n\ | 526 | \n\ |
@@ -523,11 +529,12 @@ With no FILE, or when FILE is -, read standard input.\n\ | |||
523 | -n=N output the last N lines, instead of last 10\n\ | 529 | -n=N output the last N lines, instead of last 10\n\ |
524 | -q never output headers giving file names\n\ | 530 | -q never output headers giving file names\n\ |
525 | -v always output headers giving file names\n\ | 531 | -v always output headers giving file names\n\ |
526 | --help display this help and exit\n\ | ||
527 | \n\ | 532 | \n\ |
528 | If the first character of N (bytes or lines) is a `+', output begins with \n\ | 533 | If the first character of N (bytes or lines) is a `+', output begins with \n\ |
529 | the Nth item from the start of each file, otherwise, print the last N items\n\ | 534 | the Nth item from the start of each file, otherwise, print the last N items\n\ |
530 | in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n\n"; | 535 | in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).\n" |
536 | #endif | ||
537 | ; | ||
531 | 538 | ||
532 | static void write_header(const char *filename, const char *comment) | 539 | static void write_header(const char *filename, const char *comment) |
533 | { | 540 | { |