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: Paul Eggert
Subject: Re: ordering of args gives different results for du
Date: Mon, 04 Jun 2007 10:26:32 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

"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?

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).

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e3a7ec1..f89db18 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -573,6 +573,7 @@ you prefer powers of 1024.
 @cindex human-readable output
 Append a size letter to each size, such as @samp{M} for mebibytes.
 Powers of 1024 are used, not 1000; @samp{M} stands for 1,048,576 bytes.
+This option is equivalent to @option{--block-size=human-readable}.
 Use the @option{--si} option if you prefer powers of 1000.
 @end macro

@@ -9765,13 +9766,7 @@ Output a null byte at the end of each line, rather than 
a newline.
 This option enables other programs to parse the output of @command{du}
 even when that output would contain file names with embedded newlines.

address@hidden --si
address@hidden --si
address@hidden SI output
-Append an SI-style abbreviation to each size, such as @samp{MB} for
-megabytes.  Powers of 1000 are used, not 1024; @samp{MB} stands for
-1,000,000 bytes.  Use the @option{-h} or @option{--human-readable} option if
-you prefer powers of 1024.
address@hidden

 @item -s
 @itemx --summarize
M doc/ChangeLog
M doc/coreutils.texi
Committed as 2d62d8d2d31e3a3d85066f3990ce2bcd10be3f85




reply via email to

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