NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/44747: Minor errors in cut(1)'s manpage and usage lines



>Number:         44747
>Category:       bin
>Synopsis:       Minor errors in cut(1)'s manpage and usage lines
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 21 00:40:00 +0000 2011
>Originator:     Bug Hunting
>Release:        NetBSD 5.99.48
>Organization:
>Environment:
>Description:
Some minor errors exist in cut(1)'s manpage and usage lines.
>How-To-Repeat:
"man -s 1 cut"; note that the mentioning of columns and fields isn't equal in 
the
whole of the text (it would increase readability if it did), and that the 
latter is even
missing at one place.

Also issue the following:

$ cut     # shows `Usage' line with an occurence of `file1'
usage:  cut -b list [-n] [file ...]
        cut -c list [file1 ...]
        cut -f list [-d delim] [-s] [file ...]
$ cut -ba # shows `-b' option missing
cut: [-cf] list: illegal list value
$ cut -b0 # shows `-b' option missing
cut: [-cf] list: values may not include zero
>Fix:
Apply the following patch:

$ cd /usr/src/usr.bin/cut/; cvs diff -u
cvs diff: Diffing .
Index: cut.1
===================================================================
RCS file: /cvsroot/src/usr.bin/cut/cut.1,v
retrieving revision 1.16
diff -u -r1.16 cut.1
--- cut.1       29 Mar 2009 05:58:41 -0000      1.16
+++ cut.1       21 Mar 2011 00:33:50 -0000
@@ -32,7 +32,7 @@
 .\"
 .\"     @(#)cut.1      8.1 (Berkeley) 6/6/93
 .\"
-.Dd December 21, 2008
+.Dd March 21, 2011
 .Dt CUT 1
 .Os
 .Sh NAME
@@ -71,7 +71,7 @@
 .Ar list
 can be in terms of column position or in terms of fields delimited
 by a special character.
-Column numbering starts from 1.
+Column and field numbering start from 1.
 .Pp
 .Ar list
 is a comma or whitespace separated set of increasing numbers and/or
@@ -79,14 +79,14 @@
 Number ranges consist of a number, a dash
 .Pq Li \- ,
 and a second number
-and select the fields or columns from the first number to the second,
+and select the columns or fields from the first number to the second,
 inclusive.
 Numbers or number ranges may be preceded by a dash, which selects all
-fields or columns from 1 to the first number.
+columns or fields from 1 to the first number.
 Numbers or number ranges may be followed by a dash, which selects all
-fields or columns from the last number to the end of the line.
+columns or fields from the last number to the end of the line.
 Numbers and number ranges may be repeated, overlapping, and in any order.
-It is not an error to select fields or columns not present in the
+It is not an error to select columns or fields not present in the
 input line.
 .Pp
 The options are as follows:
Index: cut.c
===================================================================
RCS file: /cvsroot/src/usr.bin/cut/cut.c,v
retrieving revision 1.25
diff -u -r1.25 cut.c
--- cut.c       21 Jul 2008 14:19:22 -0000      1.25
+++ cut.c       21 Mar 2011 00:33:50 -0000
@@ -166,7 +166,7 @@
         * This parser is less restrictive than the Draft 9 POSIX spec.
         * POSIX doesn't allow lists that aren't in increasing order or
         * overlapping lists.  We also handle "-3-5" although there's no
-        * real reason too.
+        * real reason to.
         */
        for (; (p = strtok(list, ", \t")) != NULL; list = NULL) {
                setautostart = start = stop = 0;
@@ -189,9 +189,9 @@
                        }
                }
                if (*p)
-                       errx(1, "[-cf] list: illegal list value");
+                       errx(1, "[-bcf] list: illegal list value");
                if (!stop || !start)
-                       errx(1, "[-cf] list: values may not include zero");
+                       errx(1, "[-bcf] list: values may not include zero");
                if (stop + 1 > numpositions) {
                        size_t newsize;
                        newsize = roundup(stop + 1, ALLOC_CHUNK);
@@ -286,7 +286,7 @@
 usage(void)
 {
        (void)fprintf(stderr, "Usage:\tcut -b list [-n] [file ...]\n"
-           "\tcut -c list [file1 ...]\n"
+           "\tcut -c list [file ...]\n"
            "\tcut -f list [-d delim] [-s] [file ...]\n");
        exit(1);
 }



Home | Main Index | Thread Index | Old Index