ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <>
Subject Re: [PROPOSAL] Chop task
Date Thu, 15 Nov 2001 00:08:12 GMT

Rather than writing a new task, adding this functionality to the <fixcrlf>
task may be appropriate.  In addition to fixing newlines, the task can fix
tabs.  Trimming trailing whitespace is related to what the task already
supports so it seems to me to be a logical extension of the existing

If however, you want to trim arbitrary characters then it should probably
be done as a new task.

Although this could be done with the proposed <sed> task, it's not a "Pure
Java" solution.


Magesh Umasankar wrote:
> Hi,
> I propose to create a task somewhat along the lines of
> perl's chop.  Given a file(set) and a character, if
> a line in the file ends with the specified character,
> that character will be chopped off from the line.
> An option to recursively do it can also be specified.
> A use case for this task is to remove whitespace chars
> introduced at the end of a line and to also remove
> lines which contain nothing but spaces.  This would
> make sense for a couple of reasons, at least:
> 1. occupies less storage.
> 2. behaves consistently across editors. For example,
> java source code lines ending with spaces are 'rtrim'med
> in Textpad, while vi wouldn't care.
> The motivation behind this is that the Apache License has
> a lot of trailing spaces and the cvs diffs that I make
> always spit out these lines as diffs even though there's
> been no real change.  If I do cvs diff -w, then I lose
> the whitespace changes that have relevance too :-(
> Maybe we will never remove trailing whitespaces from all
> of Apache's code for various reasons, but do you think
> such a task would at least be useful?  I would appreciate
> any and all inputs that you provide.
> Magesh

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message