[Top][All Lists]

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

Re: Final point in new option of join

From: Pádraig Brady
Subject: Re: Final point in new option of join
Date: Fri, 12 Feb 2010 00:05:48 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100111 Thunderbird/3.0.1

On 11/02/10 21:29, Jim Meyering wrote:
Pádraig Brady wrote:
Actually there are a few more instance of that (due to me):

$ grep -E "  -.*  [A-Z]" *.c | grep -v "FILE"
base64.c:  -d, --decode          Decode data\n\
base64.c:  -i, --ignore-garbage  When decoding, ignore non-alphabet 
base64.c:  -w, --wrap=COLS       Wrap encoded lines after COLS character 
(default 76).\n\
stdbuf.c:  -i, --input=MODE   Adjust standard input stream buffering\n\
stdbuf.c:  -o, --output=MODE  Adjust standard output stream buffering\n\
stdbuf.c:  -e, --error=MODE   Adjust standard error stream buffering\n\
truncate.c:  -o, --io-blocks        Treat SIZE as number of IO blocks instead 
of bytes\n\

It would be nice to have a syntax-check for this, though I
can't think of anything robust enough.  Hmm maybe if I grep man/*

Good idea.
Here's a first cut.
It would have to search only .c files.

This one currently ignores 2nd and subsequent lines of
multi-line descriptions.

That's why I didn't consider it robust enough :)

# This spots a capital on a short-only line (currently only one false positive)
git grep -E '^ {0,7}-\w( ?[^ ]+)?   *[A-Z][a-z]'

# This matches lines with a long option and optional preceding short option:
git grep -E '^   {0,7}(-\w( ?[^ ]+)?, )?--[^ ]*   *[A-Z][a-z]'

I had been trying this which seems to handle both:
grep -E " {2,6}-.*[^.]  [A-Z][a-z]" *.c

Searching man files allows us to take advantage of the extra
formatting to catch all cases (even though there currently any
extra found by this):
grep -E '^\\fB\\-' -A1 man/*.1 | grep '\.1.[A-Z][a-z]'

I'll play around with it some more and come up with something.


reply via email to

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