[Top][All Lists]

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

Re: [PATCH] csplit: new option --suppress-matched

From: Pádraig Brady
Subject: Re: [PATCH] csplit: new option --suppress-matched
Date: Wed, 10 Apr 2013 12:49:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 03/31/2013 02:19 AM, Assaf Gordon wrote:
> On 03/30/13 01:08, Pádraig Brady wrote:
>> On 03/28/2013 10:10 PM, Assaf Gordon wrote:
>>>> Attached is a new option for csplit, suppress-matched, as been mentioned 
>>>> few times before (e.g. 
>>>> ).
>> The awkward case here is with integer boundaries and offsets.
> <...>
>> # Adding in the offset, we currently consider the
>> # offset line as the one to suppress, rather than the matched pattern.
> This was exactly my original understanding of "matched" - not just "the line 
> that matched the regular expression",
> but the line that matched the specified pattern (i.e. regexp+offset or 
> integer pattern) - and that's the line suppressed.
>> This could be confusing, but at least it's consistent.
>> So more accurately what we're doing is suppressing the boundary line.
>> So less confusingly and more accurately,
>> this option should probably be named/described as:
>> --suppress-boundary
>>    Suppress the boundary line from the start of the second and subsequent 
>> splits.
> I'm fine with whichever name you decide. I find "matched" more natural, and 
> not so confusing, but boundary is just as good.
> I do think the description is a bit cumbersome (the "from the start of the 
> second and subsequent splits" part) - it seems more confusing to me than with 
> just omitting it.
> It's probably one of those cases that a single example of input+output is 
> worth more than a whole paragraph of explanation...

OK I stayed with --suppress-matched
I've just added the extra "boundary" description to the texinfo explanation.

Note I've removed the -m short option since we try to avoid them for new stuff.
Also it gives us the flexibility in future to add a param to --suppress-matched
to suppress X lines before/around/after the matched line, which could also be 

Note I needed to fix array references in the perl test as follows:
-                push $new_ent, $cmp;
+                push @$new_ent, $cmp;

-            push $new_ent, $post;
+            push @$new_ent, $post;

-            push $new_ent, $pre;
+            push @$new_ent, $pre;

-            push $new_ent, $e;
+            push @$new_ent, $e;

Will push in a while...


reply via email to

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