bug-coreutils
[Top][All Lists]
Advanced

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

Re: cut manpage is buggy


From: Eric Blake
Subject: Re: cut manpage is buggy
Date: Thu, 05 Apr 2007 06:39:23 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Rudolf Kastl on 4/5/2007 6:33 AM:
> Hello to you!
> 
> actually the cut manpage has a bug in it:

Which is generated from 'cut --help', but that has the same problem.

> 
> SYNOPSIS
>        cut [OPTION]... [FILE]...
> 
> implies that it does need neither an option set nor files listed.

Whereas POSIX lists three synopses, and later in 'cut --help' mentions
that cut requires exactly one of -b, -c, or -f (unless you are using
- --help or --version).

How about this for a patch:

ChangeLog:
2007-04-05  Eric Blake  <address@hidden>

        * src/cut.c (usage): Improve --help output.
        Reported by Rudolf Kastl.

doc/ChangeLog:
2007-04-05  Eric Blake  <address@hidden>

        * coreutils.texi (cut invocation): Improve cut synopsis.
        Reported by Rudolf Kastl.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGFO3684KuGfSFAYARAmf7AJ46rHb0wrswdP51omVy2Wj/B3H+DACghDR6
cwdHyIeYzGdkEeZSar/MRKM=
=eOuo
-----END PGP SIGNATURE-----
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 81b1fc7..d211515 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -4921,7 +4921,9 @@ input file, or standard input if no files are given or 
for a file name of
 @samp{-}.  Synopsis:
 
 @example
-cut address@hidden@dots{} address@hidden@dots{}
+cut -b @var{byte-list} address@hidden@dots{} address@hidden@dots{}
+cut -c @var{character-list} address@hidden@dots{} address@hidden@dots{}
+cut -f @var{field-list} address@hidden@dots{} address@hidden@dots{}
 @end example
 
 In the table which follows, the @var{byte-list}, @var{character-list},
diff --git a/src/cut.c b/src/cut.c
index c9b8359..fc385bf 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -1,5 +1,5 @@
 /* cut - remove parts of lines of files
-   Copyright (C) 1997-2006 Free Software Foundation, Inc.
+   Copyright (C) 1997-2007 Free Software Foundation, Inc.
    Copyright (C) 1984 David M. Ihnat
 
    This program is free software; you can redistribute it and/or modify
@@ -186,7 +186,9 @@ usage (int status)
   else
     {
       printf (_("\
-Usage: %s [OPTION]... [FILE]...\n\
+Usage: %s -b LIST [OPTION]... [FILE]...\n\
+  or:  %s -c LIST [OPTION]... [FILE]...\n\
+  or:  %s -f LIST [OPTION]... [FILE]...\n\
 "),
              program_name);
       fputs (_("\

reply via email to

[Prev in Thread] Current Thread [Next in Thread]