bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: Proposed new feature: head --show-truncation


From: Ed Avis
Subject: Re: Proposed new feature: head --show-truncation
Date: Fri, 22 Aug 2003 13:51:15 +0100 (BST)

On Thu, 21 Aug 2003, Paul Jarc wrote:

>>I am hoping to consider whether the --show-truncation flag makes
>>head more powerful, in that it couldn't be emulated by the existing
>>head plus a couple of lines of shell.
>
>It would indeed add something to head that can't already be done
>with head.  But that does not imply that head is the right place to
>add this code.

Of course.  You also have to consider whether it fits naturally with
what head already does.  Many of the GNU utilities have extra options
(compared to classic Unix) which don't change the essential purpose of
the command, but make it do its existing task better or a bit
differently.

In this case, head's job is to truncate some input after a certain
number of lines or bytes; or to print the whole input if it didn't
exceed that number.  --show-truncation doesn't change that, but
additionally gives some feedback on which of the two was chosen, in a
banner format that matches what head already prints at the top of each
file.

I originally did implement the functionality as a Perl script, but
then realized that head is a more natural place to put the code.  Of
course that would not be the case for some wacky extension that has
nothing to do with truncating text.

-- 
Ed Avis <address@hidden>






reply via email to

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