On 09/18/2012 12:04 PM, Pádraig Brady wrote:
> On 09/18/2012 10:47 AM, Bernhard Voelker wrote:
>> For the implementation of the new --output option, and the cleanup
>> necessarily coming with it, I'd like to fix that so that a -P will
>> override a previous -i and vice versa:
>>
>>    $ src/df -iP | head -n 2
>>    src/df: warning: option '-P' is overriding the previous mode
>>    Filesystem     1024-blocks      Used Available Capacity Mounted on
>>    rootfs            12095032   7515424   3965208      66% /
>>
>>    $ src/df -Pi | head -n 2
>>    src/df: warning: option '-i' is overriding the previous mode
>>    Filesystem       Inodes   IUsed    IFree IUse% Mounted on
>>    rootfs           768544  237523   531021   31% /
>>
>> WDYT?
> 
> I don't like order being significant.

Good point.

> du -i is an extension to POSIX, so I think it's fine for -i to override.

s/du/df/ i guess ;-)

> -P essentially meant don't wrap but that's moot now,

That was actually my question: -P means "default mode" in
the first place, i.e. one could read it as "print block size".
And now comes -i ...

> but I'd keep it as is for backwards compat.

... another good point - and I think I should stick with it.
So as -P does nothing, shouldn't df print a warning that
it disregards it when -i is in effect?

I thought that I could get rid of the mashing up of the scale
factor (human_output_opts, output_block_size) and df's main
modes DEFAULT_MODE, INODES_MODE, POSIX_MODE and HUMAN_MODE)
somehow ... because the same question will arise again with
'df -P --out=...' ;-/
IMHO the cleanest solution would be to make the main modes
-i, -p and the new --o mutually exclusive.

Have a nice day,
Berny

Reply via email to