URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16635>

                 Summary: synopsis on man page shows pattern as optional
                 Project: grep
            Submitted by: bens
            Submitted on: Saturday 05/20/2006 at 16:55
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open

    _______________________________________________________

Details:


The synopsis of grep on its man page says:

  grep [OPTIONS] PATTERN [FILE...]
  grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]

The second line gives the impression that a pattern and pattern file are
optional, which is mistaken.  How to express this correctly in a single line,
I dont't know.  The synopsis on
http://www.opengroup.org/onlinepubs/009695399/utilities/grep.html takes three
lines to show that either a pattern or a pattern file should be given.

Maybe this is an alternative:

  grep [OPTIONS] [-e] PATTERN [FILE...]
  grep [OPTIONS] -f FILE [FILE...]

But in fact GNU grep allows -e and -f together, and even mutiple -e's and
-f's, so a fully descriptive synopsis would be:

  grep [OPTIONS] [-e] PATRN [-e PATRN]... [-f FILE]... FILE...]
  grep [OPTIONS] [-e PATRN]... -f FILE [-f FILE]... [FILE...]

But this is... ugly.






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16635>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



Reply via email to