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

 
 

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

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

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sat 20 May 2006 02:55:24 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned 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>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item

Back to the top


Powered by Savane 3.1-cleanup