bug-coreutils
[Top][All Lists]
Advanced

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

Re: ordering of args gives different results for du


From: Jim Meyering
Subject: Re: ordering of args gives different results for du
Date: Mon, 04 Jun 2007 19:41:13 +0200

Paul Eggert <address@hidden> wrote:
> "Steve Ward" <address@hidden> writes:
>
>> The following commands give different results:
>>    du --bytes --human-readable foo.txt
>>    du --human-readable --bytes foo.txt
>
> --bytes is equivalent to --apparent-size --block-size=1; this is --documented.
> --human-readable is equivalent to --block-size=human-readable; this is
> --not documented, which is a documentation bug.  The later implicit
> ----block-size option wins, which explains the behavior you observe.
>
> I also dislike it when option order affects behavior.  Perhaps "du"
> should complain about inconsistent options like that?

That sounds like it'd be an improvement, and I'm willing
to try it, if someone else does the work :-)
However, we'll have to be prepared for some flak, since
people with aliases like "du='du -k'" would start getting
a warning whenever they use e.g., "du -h".
Maybe it'd be palatable with a few strategic exceptions.
But then maybe it's not worth the hassle.

In retrospect, I'm pretty sure it's too late to change this.

> But if we leave the behavior alone, at least it should be documented
> correctly.  Here's a proposed patch to document the current behavior
> more accurately, which is a minimal fix for now.
>
> 2007-06-04  Paul Eggert  <address@hidden>
>
>       * doc/coreutils.texi (Common options): Mention that -h and
>       --human-readable are equivalent to --block-size=human-readable.
>       Documentation problem reported by Steve Ward in
>       <http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00007.html>.
>       (du invocation): Use optSi rather than duplicating the macro's
>       contents (incorrectly, since we claimed a "B" was output).

Thanks!
Applied.




reply via email to

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