|
From: | Julian Foad |
Subject: | Re: Question about "-m1 -A99" tests in foad1.sh |
Date: | Thu, 03 Nov 2005 16:54:02 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 |
Charles Levert wrote:
grep_test "4/40/" "4/40/" "^4" -m1 -A99 grep_test "4/04/" "4/04/" "^4" -m1 -A99
As I understand the intent, the second line of input should be printed whether it would match or not, solely because it is part of the specified number of context lines. However, if other options such as --with-filename, --line-number, --byte-offset, and/or --color=always are used, and if any line that is part of the after-context would also have matched on its own given the chance, should it be marked as matching or not? I.e., what separator should be used for such a line (':' or '-') and how should it be colorized?
That's a good question. I can't yet think of a reason to prefer one way over the other.
My gut feeling is that we should display such lines as context lines regardless of whether they happen to match.
(One thing is certain: if we choose to display a context line that happens to match as as matching line, we must not re-start the counting of context lines.)
- Julian
[Prev in Thread] | Current Thread | [Next in Thread] |