On 07/10/10 18:43, Assaf Gordon wrote:
> 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.

Well seeing as -e without -o currently does nothing,
I don't think we need to worry too much about changing that behavior.
Also to me, specifying -e EMPTY implicitly means I want
fields missing from one of the files replaced with EMPTY.

Note POSIX is more explicit, and describes our current operation:

-e EMPTY
  Replace empty output fields in the list selected by -o with EMPTY

So changing that would be an extension to POSIX.
But I still think it makes sense.
I'll prepare a patch soon, to do as I describe above,
unless there are objections.

cheers,
Pádraig.

Reply via email to