bug-coreutils
[Top][All Lists]
Advanced

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

bug#10915: 8.13: df -- overly long output lines are very hard to read


From: Jim Meyering
Subject: bug#10915: 8.13: df -- overly long output lines are very hard to read
Date: Fri, 27 Jul 2012 14:04:25 +0200

Pádraig Brady wrote:
...
>>   df --printf="%U\0%s\0%m\0\n"
>>
>> As already said, this would be a greater change in df.c,
>> but some code could surely be shared with stat.c and maybe
>> in future with "ls --format=..." ;-)
>>
>> I'm not against --output, but the advantage of a more
>> flexible --printf is unbeatable IMO.
>
> 60:40 for --output as ordering/selection is needed by some
> 40:60 against --printf as detailed formatting is neede by few

At first I was going to say I'm 50:50,
but as I wrote, the balance tipped in favor of --output,
maybe even to 70:30.

A big factor for me was that here we want a column-selecting
option, rather than a true printf-like format-specifying option.
Of course we could augment the format-specifying option with
semantics that delimit columns and that allow us to specify
alternate formatting/units per column, but that would be something
new.  The simpler column-selecting facility (like that of say, ps)
seems attractive.

While added flexibility of --printf=FMT would be nice, it seems like it
would come at a price (more code and more complexity), and as Pádraig
says, in df the feature might not be used enough to justify the expense.
A point in --printf's favor is consistency with stat's option name and
the someday-in-ls option name.  I prefer --printf over --format because
in stat, --format always evokes a trailing newline.

However, it is hard to judge without seeing the actual changes.
If you feel strongly about it, go ahead and implement your preference.
Maybe the resulting code will be small and clean enough that the added
flexibility will be an obvious net gain.





reply via email to

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