[Top][All Lists]

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

Re: Student contribution

From: Pádraig Brady
Subject: Re: Student contribution
Date: Wed, 10 May 2017 16:56:46 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 10/05/17 16:06, Desirée Zahradnicek wrote:
> 2017-05-08 9:08 GMT-03:00 Pádraig Brady <address@hidden>:
>> On 07/05/17 15:58, Desirée Zahradnicek wrote:
>>> Hi, mi name is Desirée Zahradnicek and I'm in the last year of
>>> Information Systems Engineering. As a requirement for subject called
>>> Free Software I have to make a contribution to a free software
>>> project, and I thought about contributing to coreutils.
>>> I have a small but useful idea in mind, I'm thinking about adding an
>>> option to the program "tail" to make it print the last lines of a file
>>> filling the terminal height. I think this could be very useful on its
>>> own and more so in combination with watch. I created a really small
>>> shell script to emulate the functionality:
>>> #!/bin/bash
>>> nlines=$(( $(tput lines) - 2 ))
>>> tail -$nlines $1
>>> I'm writing to ask if you think this could be included so I can start
>>> to work on it.
>> Thanks for considering coreutils!
>> As for this particular functionality, it definitely _is_ useful.
>> I myself use this alias:
>>   alias tail='tail -n $((${LINES:-12}-2))'
>> However considering the relatively simple alias to achieve this functionality
>> it's probably better to not couple that within tail itself.
>> Would you perhaps consider some other coreutils patch?
>> For example it would be useful for `sort --debug` to print extra info.
>>  1. print memory space available.
>>    I.E. allocated internal buffer sizes and space avail at $TMPDIR(s)
>>  2. output if locale is specific to the sort.
>>    I.E. if strcoll() and memcmp() differ in direction
> It's true that this functionality can be achieved very easily with a
> simple script, but the point is that it being so useful it's a letdown
> that it isn't incorporated already, and so people that needs it have
> to go creating/googling a solution. I know it's much more work to have
> it built in, and that as with all modifications there's always the
> risk of breaking something, but on the plus side I'll be the one doing
> the work, and as it adds an optional functionality it's not expected
> to cause trouble if not used.
> What do you say, do we give it a shot?

Well if you did you'd also have to add the option to head(1) for consistency.
So with two commands getting extra options it starts to look a bit
less enticing. Those options have to be documented thus complicating
the docs for users, and if used with older versions of head/tail will fail.
Also these options are tending more towards user preference config
rather than once off functionality selection, and thus would probably
be mostly used in aliases anyway.
Given the functionality can be achieved with a simple standard shell
alias/function, I'm still not convinced it's needed, and I'm
currently 60:40 against adding it.


reply via email to

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