From 7cdc7a0bd9dfa7a106a27115eb6fa1a3ee0f28ad Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 13 May 1995 18:34:54 +0000 Subject: [PATCH] (usage): Include one- or two-line synopsis in --help output. From Karl Berry. --- src/cat.c | 1 + src/cksum.c | 1 + src/comm.c | 1 + src/csplit.c | 2 ++ src/cut.c | 1 + src/expand.c | 5 +++-- src/fmt.c | 7 ++++--- src/fold.c | 2 ++ src/head.c | 6 ++++-- src/join.c | 6 ++++-- src/nl.c | 3 ++- src/od.c | 7 ++++--- src/paste.c | 4 +++- src/pr.c | 1 + src/sort.c | 1 + src/split.c | 4 ++-- src/sum.c | 1 + src/tac.c | 4 ++-- src/tail.c | 5 ++++- src/tr.c | 6 ++++-- src/unexpand.c | 5 +++-- src/uniq.c | 7 ++++--- src/wc.c | 9 ++++----- 23 files changed, 58 insertions(+), 31 deletions(-) diff --git a/src/cat.c b/src/cat.c index 764778f..8c250fc 100644 --- a/src/cat.c +++ b/src/cat.c @@ -91,6 +91,7 @@ Usage: %s [OPTION] [FILE]...\n\ ", program_name); printf ("\ +Concatenate FILE(s), or standard input, to standard output.\n\ \n\ -b, --number-nonblank number nonblank output lines\n\ -e equivalent to -vE\n\ diff --git a/src/cksum.c b/src/cksum.c index 28b58e1..9b1e79e 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -274,6 +274,7 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Print CRC checksum and byte counts of each FILE.\n\ \n\ --help display this help and exit\n\ --version output version information and exit\n\ diff --git a/src/comm.c b/src/comm.c index 1df70a5..ad980d7 100644 --- a/src/comm.c +++ b/src/comm.c @@ -255,6 +255,7 @@ Usage: %s [OPTION]... LEFT_FILE RIGHT_FILE\n\ ", program_name); printf ("\ +Compare sorted files LEFT_FILE and RIGHT_FILE line by line.\n\ \n\ -1 suppress lines unique to left file\n\ -2 suppress lines unique to right file\n\ diff --git a/src/csplit.c b/src/csplit.c index dedbec8..cf1257d 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -1564,6 +1564,8 @@ Usage: %s [OPTION]... FILE PATTERN...\n\ ", program_name); printf ("\ +Output pieces of FILE separated by PATTERN(s) to files `xx01', `xx02', ...,\n\ +and output byte counts of each piece to standard output.\n\ \n\ -b, --suffix-format=FORMAT use sprintf FORMAT instead of %%d\n\ -f, --prefix=PREFIX use PREFIX instead of `xx'\n\ diff --git a/src/cut.c b/src/cut.c index 132373a..cd103d3 100644 --- a/src/cut.c +++ b/src/cut.c @@ -201,6 +201,7 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Print selected parts of lines from each FILE to standard output.\n\ \n\ -b, --bytes=LIST output only these bytes\n\ -c, --characters=LIST output only these characters\n\ diff --git a/src/expand.c b/src/expand.c index 2488711..d7366a2 100644 --- a/src/expand.c +++ b/src/expand.c @@ -398,6 +398,8 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Convert tabs in each FILE to spaces, writing to standard output.\n\ +With no FILE, or when FILE is -, read standard input.\n\ \n\ -i, --initial do not convert TABs after non whitespace\n\ -t, --tabs=NUMBER have tabs NUMBER characters apart, not 8\n\ @@ -405,8 +407,7 @@ Usage: %s [OPTION]... [FILE]...\n\ --help display this help and exit\n\ --version output version information and exit\n\ \n\ -Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used. With\n\ -no FILE, or when FILE is -, read standard input.\n\ +Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used.\n\ "); } exit (status); diff --git a/src/fmt.c b/src/fmt.c index 506d1cc..1d15651 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -274,8 +274,10 @@ usage (status) { printf ("Usage: %s [-DIGITS] [OPTION]... [FILE]...\n", program_name); fputs ("\ -Mandatory arguments to long options are mandatory for short options too.\n\ +Reformat each paragraph in the FILE(s), writing to standard output.\n\ +If no FILE or if FILE is `-', standard input is read.\n\ \n\ +Mandatory arguments to long options are mandatory for short options too.\n\ -c, --crown-margin preserve indentation of first two lines\n\ -s, --split-only split long lines, but do not refill\n\ -t, --tagged-paragraph indentation of first line different from second\n\ @@ -285,8 +287,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ --help display this help and exit\n\ --version output version information and exit\n\ \n\ -In -wNUMBER, the letter `w' may be omitted. Input FILEs are concatenated.\n\ -If no FILE or if FILE is `-', standard input is read.\n", +In -wNUMBER, the letter `w' may be omitted.\n", stdout); } exit (status); diff --git a/src/fold.c b/src/fold.c index 1da75cc..2dfd30f 100644 --- a/src/fold.c +++ b/src/fold.c @@ -77,6 +77,8 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Wrap input lines in each FILE (standard input by default), writing to\n\ +standard output.\n\ \n\ -b, --bytes count bytes rather than columns\n\ -s, --spaces break at word boundaries\n\ diff --git a/src/head.c b/src/head.c index 07c2782..67e0f15 100644 --- a/src/head.c +++ b/src/head.c @@ -386,6 +386,9 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Print first 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\ -c, --bytes=SIZE print first SIZE bytes\n\ -n, --lines=NUMBER print first NUMBER lines instead of first 10\n\ @@ -396,8 +399,7 @@ Usage: %s [OPTION]... [FILE]...\n\ \n\ SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.\n\ If -VALUE is used as first OPTION, read -c VALUE when one of\n\ -multipliers bkm follows concatenated, else read -n VALUE. With no\n\ -FILE, or when FILE is -, read standard input.\n\ +multipliers bkm follows concatenated, else read -n VALUE.\n\ "); } exit (status); diff --git a/src/join.c b/src/join.c index 26b855d..3d0320a 100644 --- a/src/join.c +++ b/src/join.c @@ -753,6 +753,9 @@ Usage: %s [OPTION]... FILE1 FILE2\n\ ", program_name); printf ("\ +For each pair of input lines with identical join fields, write a line to\n\ +standard output. The default join field is the first, delimited\n\ +by whitespace. When FILE1 or FILE2 (not both) is -, read standard input.\n\ \n\ -a SIDE print unpairable lines coming from file SIDE\n\ -e EMPTY replace missing input fields with EMPTY\n\ @@ -764,8 +767,7 @@ Usage: %s [OPTION]... FILE1 FILE2\n\ --help display this help and exit\n\ --version output version information and exit\n\ \n\ -When FILE1 or FILE2 is -, not both, read standard input. SIDE is 1\n\ -for FILE1 or 2 for FILE2. Unless -t CHAR is given, leading blanks\n\ +SIDE is 1 for FILE1 or 2 for FILE2. Unless -t CHAR is given, leading blanks\n\ separate fields and are ignored, else fields are separated by CHAR.\n\ Any FIELD is a field number counted from 1. FORMAT is one or more\n\ comma or blank separated specifications, each being `SIDE.FIELD'.\n\ diff --git a/src/nl.c b/src/nl.c index e7a155a..f9ac3c9 100644 --- a/src/nl.c +++ b/src/nl.c @@ -567,6 +567,8 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Write each FILE to standard output, with line numbers added.\n\ +With no FILE, or when FILE is -, read standard input.\n\ \n\ -b, --body-numbering=STYLE use STYLE for numbering body lines\n\ -d, --section-delimiter=CC use CC for separating logical pages\n\ @@ -597,7 +599,6 @@ FORMAT is one of:\n\ rn right justified, no leading zeros\n\ rz right justified, leading zeros\n\ \n\ -With no FILE, or when FILE is -, read standard input.\n\ "); } exit (status); diff --git a/src/od.c b/src/od.c index fb9a927..99d9994 100644 --- a/src/od.c +++ b/src/od.c @@ -312,6 +312,8 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name, program_name); printf ("\ +Write an unambiguous representation, octal bytes by default, of FILE\n\ +to standard output. With no FILE, or when FILE is -, read standard input.\n\ \n\ -A, --address-radix=RADIX decide how file offsets are printed\n\ -N, --read-bytes=BYTES limit dump to BYTES input bytes per file\n\ @@ -320,8 +322,8 @@ Usage: %s [OPTION]... [FILE]...\n\ -t, --format=TYPE select output format or formats\n\ -v, --output-duplicates do not use * to mark line suppression\n\ -w, --width[=BYTES] output BYTES bytes per output line\n\ - --help display this help and exit\n\ --traditional accept arguments in pre-POSIX form\n\ + --help display this help and exit\n\ --version output version information and exit\n\ \n\ Pre-POSIX format specifications may be intermixed, they accumulate:\n\ @@ -362,8 +364,7 @@ RADIX is d for decimal, o for octal, x for hexadecimal or n for none.\n\ BYTES is hexadecimal with 0x or 0X prefix, it is multiplied by 512\n\ with b suffix, by 1024 with k and by 1048576 with m. -s without a\n\ number implies 3. -w without a number implies 32. By default, od\n\ -uses -A o -t d2 -w 16. With no FILE, or when FILE is -, read standard\n\ -input.\n\ +uses -A o -t d2 -w 16.\n\ "); } exit (status); diff --git a/src/paste.c b/src/paste.c index d489136..69b2815 100644 --- a/src/paste.c +++ b/src/paste.c @@ -489,13 +489,15 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Write lines consisting of the sequentially corresponding lines from\n\ +each FILE, separated by TABs, to standard output.\n\ +With no FILE, or when FILE is -, read standard input.\n\ \n\ -d, --delimiters=LIST reuse characters from LIST instead of TABs\n\ -s, --serial paste one file at a time instead of in parallel\n\ --help display this help and exit\n\ --version output version information and exit\n\ \n\ -With no INPUT, or when INPUT is -, read standard input.\n\ "); } exit (status); diff --git a/src/pr.c b/src/pr.c index 5928208..234c217 100644 --- a/src/pr.c +++ b/src/pr.c @@ -1880,6 +1880,7 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Paginate or columnate FILE(s) for printing.\n\ \n\ +PAGE begin printing with page PAGE\n\ -COLUMN produce COLUMN-column output and print columns down\n\ diff --git a/src/sort.c b/src/sort.c index b187944..da7e003 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1845,6 +1845,7 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Write sorted concatenation of all FILE(s) to standard output.\n\ \n\ +POS1 [-POS2] start a key at POS1, end it before POS2\n\ -M compare (unknown) < `JAN' < ... < `DEC', imply -b\n\ diff --git a/src/split.c b/src/split.c index 421ced9..ebb3910 100644 --- a/src/split.c +++ b/src/split.c @@ -104,6 +104,8 @@ Usage: %s [OPTION] [INPUT [PREFIX]]\n\ ", program_name); printf ("\ +Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default\n\ +PREFIX is `x'. With no INPUT, or when INPUT is -, read standard input.\n\ \n\ -C, --line-bytes=SIZE put at most SIZE bytes of lines per output file\n\ -b, --bytes=SIZE put SIZE bytes per output file\n\ @@ -113,8 +115,6 @@ Usage: %s [OPTION] [INPUT [PREFIX]]\n\ --version output version information and exit\n\ \n\ SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.\n\ -With no PREFIX, use x. With no INPUT, or when INPUT is -, read\n\ -standard input.\n\ "); } exit (status); diff --git a/src/sum.c b/src/sum.c index c347250..da4ea7c 100644 --- a/src/sum.c +++ b/src/sum.c @@ -70,6 +70,7 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Print checksum and block counts for each FILE.\n\ \n\ -r defeat -s, use BSD sum algorithm, use 1K blocks\n\ -s, --sysv use System V sum algorithm, use 512 bytes blocks\n\ diff --git a/src/tac.c b/src/tac.c index 8ddfdd1..06b373b 100644 --- a/src/tac.c +++ b/src/tac.c @@ -140,14 +140,14 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Write each FILE to standard output, last line first.\n\ +With no FILE, or when FILE is -, read standard input.\n\ \n\ -b, --before attach the separator before instead of after\n\ -r, --regex interpret the separator as a regular expression\n\ -s, --separator=STRING use STRING as the separator instead of newline\n\ --help display this help and exit\n\ --version output version information and exit\n\ -\n\ -With no FILE, or when FILE is -, read standard input.\n\ "); } exit (status); diff --git a/src/tail.c b/src/tail.c index 3f6b8dd..ba9f45b 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1008,6 +1008,9 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Print 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\ -c, --bytes=N output the last N bytes\n\ -f, --follow output appended data as the file grows\n\ @@ -1023,7 +1026,7 @@ print the last N items in the file. N may have a multiplier suffix:\n\ b for 512, k for 1024, m for 1048576 (1 Meg). A first OPTION of -VALUE\n\ or +VALUE is treated like -n VALUE or -n +VALUE unless VALUE has one of\n\ the [bkm] suffix multipliers, in which case it is treated like -c VALUE\n\ -or -c +VALUE. With no FILE, or when FILE is -, read standard input.\n\ +or -c +VALUE.\n\ "); } exit (status); diff --git a/src/tr.c b/src/tr.c index 515cc85..da4f9de 100644 --- a/src/tr.c +++ b/src/tr.c @@ -326,6 +326,8 @@ Usage: %s [OPTION]... SET1 [SET2]\n\ ", program_name); printf ("\ +Translate, squeeze, and/or delete characters from standard input,\n\ +writing to standard output.\n\ \n\ -c, --complement first complement SET1\n\ -d, --delete delete characters in SET1, do not translate\n\ @@ -336,8 +338,8 @@ Usage: %s [OPTION]... SET1 [SET2]\n\ "); printf ("\ \n\ -SETs are specified as strings of characters. Most represent\n\ -themselves. Here are the special writings:\n\ +SETs are specified as strings of characters. Most represent themselves.\n\ +Interpreted sequences are:\n\ \n\ \\NNN character with octal value NNN (1 to 3 octal digits)\n\ \\\\ backslash\n\ diff --git a/src/unexpand.c b/src/unexpand.c index d841c52..afcbf4d 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -453,6 +453,8 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ +Convert spaces in each FILE to tabs, writing to standard output.\n\ +With no FILE, or when FILE is -, read standard input.\n\ \n\ -a, --all convert all whitespace, instead of initial whitespace\n\ -t, --tabs=NUMBER have tabs NUMBER characters apart instead of 8\n\ @@ -460,8 +462,7 @@ Usage: %s [OPTION]... [FILE]...\n\ --help display this help and exit\n\ --version output version information and exit\n\ \n\ -Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used. With\n\ -no FILE, or when FILE is -, read standard input.\n\ +Instead of -t NUMBER or -t LIST, -NUMBER or -LIST may be used.\n\ "); } exit (status); diff --git a/src/uniq.c b/src/uniq.c index 64a5da3..334bbf3 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -348,6 +348,8 @@ Usage: %s [OPTION]... [INPUT [OUTPUT]]\n\ ", program_name); printf ("\ +Discard all but one of successive identical lines from INPUT (or\n\ +standard input), writing to OUTPUT (or standard output).\n\ \n\ -c, --count prefix lines by the number of occurrences\n\ -d, --repeated only print duplicate lines\n\ @@ -360,9 +362,8 @@ Usage: %s [OPTION]... [INPUT [OUTPUT]]\n\ --help display this help and exit\n\ --version output version information and exit\n\ \n\ -A field is a run of whitespace, than non whitespace characters.\n\ -Fields are skipped before chars. If OUTPUT not specified, writes to\n\ -standard output. If INPUT not specified, reads from standard input.\n\ +A field is a run of whitespace, than non-whitespace characters.\n\ +Fields are skipped before chars. \n\ "); } exit (status); diff --git a/src/wc.c b/src/wc.c index 257e3f9..e8b1208 100644 --- a/src/wc.c +++ b/src/wc.c @@ -82,15 +82,14 @@ Usage: %s [OPTION]... [FILE]...\n\ ", program_name); printf ("\ -\n\ - -c, --bytes, --chars print the byte counts\n\ +Print line, word, and byte counts for each FILE, and a total line if\n\ +more than one FILE is specified. With no FILE, or when FILE is -,\n\ +read standard input.\n\ -l, --lines print the newline counts\n\ -w, --words print the word counts\n\ + -c, --bytes, --chars print the byte counts\n\ --help display this help and exit\n\ --version output version information and exit\n\ -\n\ -Print lines, words and bytes in that order. If none of -clw, select\n\ -them all. With no FILE, or when FILE is -, read standard input.\n\ "); } exit (status); -- 2.7.4