bug-grep
[Top][All Lists]
Advanced

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

Re: --only-matching interacts badly with context lines and line head [bu


From: Tony Abou-Assaleh
Subject: Re: --only-matching interacts badly with context lines and line head [bug-grep]
Date: Wed, 23 Feb 2005 09:00:38 -0400 (AST)

> > >First, it is obvious that --only-matching does not agree
> > >with context lines.  I propose the following wholesale
> > >fix in main():
> > >
> > >  if (only_matching)
> > >    out_after = out_before = 0;
> >
> > Good point, though we probably should error rather than silently ignore
> > part of the user's command.
>
> Maybe, maybe not.  After all, it is possible to interpret
> this as "sure, we are accounting for the context lines,
> there just aren't any matches to report in them".

As long as it is properly documented in usage and man pages, either way
should be fine. I tend to favor avoiding unnecessary errors by just
voiding context if only-matching is chosen.

Cheers,

TAA

--------------------------------------------------
Tony Abou-Assaleh
Ph.D. Candidate, Faculty of Computer Science
Dalhousie University, Halifax, NS, Canada, B3H 1W5
Fax:   902-492-1517
Email: address@hidden
WWW:   http://www.cs.dal.ca/~taa/
---------------------[THE END]--------------------




reply via email to

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