buggrep - Bugs: bug #16635, synopsis on man page shows pattern...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #16635: synopsis on man page shows pattern as optional

Submitter:  Benno Schulenberg <bens>
Submitted:  Sat 20 May 2006 02:55:24 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Sun 21 May 2006 02:18:52 PM UTC, comment #2: 


> How about this synopsis instead?
>
> grep [OPTIONS] PATTERN [FILE...]
> grep [OPTIONS] -e PATTERN [FILE...]
> grep [OPTIONS] -f FILE [FILE...]


Yes, that's good.  It's even clearer than what's there now.
IMO this should go in after patch #4610 has been applied.

Benno Schulenberg <bens>
Sun 21 May 2006 12:34:11 AM UTC, comment #1: 


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


That would imply that -e is an option without an argument, which
isn't right either.

> But in fact GNU grep allows -e and -f together, and even mutiple -e's and
> -f's


That's OK.  They're all instances of OPTIONS.

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


That's confusing, and won't work if POSIXLY_CORRECT.

How about this synopsis instead?

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

Paul Eggert <eggert>
Group Member
Sat 20 May 2006 02:55:24 PM UTC, original submission:  


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.

Benno Schulenberg <bens>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code