coreutils
[Top][All Lists]
Advanced

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

Re: [coreutils] join feature: auto-format


From: Assaf Gordon
Subject: Re: [coreutils] join feature: auto-format
Date: Thu, 07 Oct 2010 13:43:22 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100918 Icedove/3.1.4

Pádraig Brady wrote, On 10/07/2010 06:22 AM:
> On 07/10/10 01:03, Pádraig Brady wrote:
>> On 06/10/10 21:41, Assaf Gordon wrote:
>>>
>>> The "--auto-format" feature simply builds the "-o" format line 
>>> automatically, based on the number of columns from both input files.
>>
>> Thanks for persisting with this and presenting a concise example.
>> I agree that this is useful and can't think of a simple workaround.
>> Perhaps the interface would be better as:
>>
>> -o {all (default), padded, FORMAT}
>>
>> where padded is the functionality you're suggesting?
> 
> Thinking more about it, we mightn't need any new options at all.
> Currently -e is redundant if -o is not specified.
> So how about changing that so that if -e is specified
> we operate as above by auto inserting empty fields?
> Also I wouldn't base on the number of fields in the first line,
> instead auto padding to the biggest number of fields
> on the current lines under consideration.

My concern is the principle of "least surprise" - if there are existing 
scripts/programs that specify "-e" without "-o" (doesn't make sense, but still 
possible) - this change will alter their behavior.

Also, implying/forcing 'auto-format' when "-e" is used without "-o" might be a 
bit confusing.
I prefer to have the user explicitly ask for auto-format - at least he/she will 
know how the output would look like.

That being said,
I can send a new patch with one of the new method (implicit autoformat or "-o 
padded") - which one is preferred ?

Thanks,
 -gordon




reply via email to

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