From nobody@FreeBSD.org  Thu Nov 10 14:23:52 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 274E5106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Nov 2011 14:23:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 179068FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Nov 2011 14:23:52 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pAAENpUG038525
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Nov 2011 14:23:51 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pAAENpbt038506;
	Thu, 10 Nov 2011 14:23:51 GMT
	(envelope-from nobody)
Message-Id: <201111101423.pAAENpbt038506@red.freebsd.org>
Date: Thu, 10 Nov 2011 14:23:51 GMT
From: Alexander Best <arundel@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: du(1) man page improvements
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         162438
>Category:       docs
>Synopsis:       [patch] du(1) man page improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gjb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 10 14:30:07 UTC 2011
>Closed-Date:    Mon Jan 02 23:51:17 UTC 2012
>Last-Modified:  Sat Jan  7 01:50:05 UTC 2012
>Originator:     Alexander Best
>Release:        10.0-CURRENT
>Organization:
>Environment:
FreeBSD otaku 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Thu Nov 10 14:01:26 CET 2011     arundel@otaku:/usr/obj/usr/git-freebsd-head/sys/ARUNDEL  amd64
>Description:
the following patch features improvements to the du(1) man page according to style(9). it also improves the wording here and there.

cheers.
alex
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
index ef8b5ac..960be23 100644
--- a/usr.bin/du/du.1
+++ b/usr.bin/du/du.1
@@ -28,7 +28,7 @@
 .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
 .\" $FreeBSD$
 .\"
-.Dd November 6, 2008
+.Dd November 10, 2011
 .Dt DU 1
 .Os
 .Sh NAME
@@ -36,15 +36,12 @@
 .Nd display disk usage statistics
 .Sh SYNOPSIS
 .Nm
-.Op Fl A
+.Op Fl Achklmnx
 .Op Fl H | L | P
-.Op Fl a | s | d Ar depth | Fl t Ar threshold
-.Op Fl c
-.Op Fl l
-.Op Fl h | k | m | B Ar blocksize
-.Op Fl n
-.Op Fl x
+.Op Fl a | s | d Ar depth
+.Op Fl B Ar blocksize
 .Op Fl I Ar mask
+.Op Fl t Ar threshold
 .Op Ar
 .Sh DESCRIPTION
 The
@@ -61,11 +58,13 @@ The options are as follows:
 Display the apparent size instead of the disk usage.
 This can be helpful when operating on compressed volumes or sparse files.
 .It Fl B Ar blocksize
-Calculate block counts in
+Calculate block count in
 .Ar blocksize
 byte blocks.
 This is different from the
-.Fl k, m
+.Fl h, k
+and
+.Fl  m
 options or setting
 .Ev BLOCKSIZE
 and gives an estimate of how much space the examined file hierarchy would
@@ -79,20 +78,45 @@ is rounded up to the next multiple of 512.
 .It Fl H
 Symbolic links on the command line are followed, symbolic links in file
 hierarchies are not followed.
-.It Fl L
-Symbolic links on the command line and in file hierarchies are followed.
 .It Fl I Ar mask
 Ignore files and directories matching the specified
 .Ar mask .
+.It Fl L
+Symbolic links on the command line and in file hierarchies are followed.
 .It Fl P
 No symbolic links are followed.
 This is the default.
 .It Fl a
 Display an entry for each file in a file hierarchy.
+.It Fl c
+Display a grand total.
+.It Fl d Ar depth
+Display an entry for all files and directories
+.Ar depth
+directories deep.
 .It Fl h
 "Human-readable" output.
 Use unit suffixes: Byte, Kilobyte, Megabyte,
 Gigabyte, Terabyte and Petabyte.
+.It Fl k
+Display block count in 1024-byte (1-Kbyte) blocks.
+.It Fl l
+If a file has multiple hard links, count its size many times.
+The default behavior of
+.Nm
+is to count files with multiple hard links only once.
+When the
+.Fl l
+option is specified, the hard link checks are disabled, and these files
+are counted (and displayed) as many times as they are found.
+.It Fl m
+Display block count in 1048576-byte (1-Mbyte) blocks.
+.It Fl n
+Ignore files and directories with user
+.Dq nodump
+flag
+.Pq Dv UF_NODUMP
+set.
 .It Fl r
 Generate messages about directories that cannot be read, files
 that cannot be opened, and so on.
@@ -111,31 +135,6 @@ If
 is negative, display only entries for which size is less than the absolute
 value of
 .Ar threshold .
-.It Fl d Ar depth
-Display an entry for all files and directories
-.Ar depth
-directories deep.
-.It Fl c
-Display a grand total.
-.It Fl k
-Display block counts in 1024-byte (1-Kbyte) blocks.
-.It Fl l
-If a file has multiple hard links, count its size many times.
-The default behavior of
-.Nm
-is to count files with multiple hard links only once.
-When the
-.Fl l
-option is specified, the hard link checks are disabled, and these files
-are counted (and displayed) as many times as they are found.
-.It Fl m
-Display block counts in 1048576-byte (1-Mbyte) blocks.
-.It Fl n
-Ignore files and directories with user
-.Dq nodump
-flag
-.Pq Dv UF_NODUMP
-set.
 .It Fl x
 File system mount points are not traversed.
 .El
@@ -152,26 +151,33 @@ If either the
 .Fl H
 or
 .Fl L
-options are specified, storage used by any symbolic links which are
-followed is not counted or displayed.
+option is specified, storage used by any symbolic links which are
+followed is not counted (or displayed).
+.Pp
+The
+.Fl h, k
+and
+.Fl m
+options all override each other; the last one specified determines
+the block count used.
 .Sh ENVIRONMENT
 .Bl -tag -width BLOCKSIZE
 .It Ev BLOCKSIZE
 If the environment variable
 .Ev BLOCKSIZE
 is set, and the
-.Fl k, m
+.Fl h, k
 or
-.Fl h
-options are not specified, the block counts will be displayed in units of
+.Fl m
+options are not specified, the block count will be displayed in units of
 that block size.
 If
 .Ev BLOCKSIZE
 is not set, and the
-.Fl k, m
+.Fl h, k
 or
-.Fl h
-options are not specified, the block counts will be displayed in 512-byte
+.Fl m
+options are not specified, the block count will be displayed in 512-byte
 blocks.
 .El
 .Sh SEE ALSO


>Release-Note:
>Audit-Trail:

From: Alexander Best <arundel@freebsd.org>
To: Benjamin Kaduk <kaduk@mit.edu>
Cc: freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: docs/162438: du(1) man page improvements
Date: Thu, 10 Nov 2011 21:27:24 +0000

 On Thu Nov 10 11, Benjamin Kaduk wrote:
 > On Thu, 10 Nov 2011, Alexander Best wrote:
 > 
 > >Patch attached with submission follows:
 > >
 > >diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
 > >index ef8b5ac..960be23 100644
 > >--- a/usr.bin/du/du.1
 > >+++ b/usr.bin/du/du.1
 > >@@ -28,7 +28,7 @@
 > >.\"	@(#)du.1	8.2 (Berkeley) 4/1/94
 > >.\" $FreeBSD$
 > >.\"
 > >-.Dd November 6, 2008
 > >+.Dd November 10, 2011
 > >.Dt DU 1
 > >.Os
 > >.Sh NAME
 > >@@ -36,15 +36,12 @@
 > >.Nd display disk usage statistics
 > >.Sh SYNOPSIS
 > >.Nm
 > >-.Op Fl A
 > >+.Op Fl Achklmnx
 > >.Op Fl H | L | P
 > >-.Op Fl a | s | d Ar depth | Fl t Ar threshold
 > >-.Op Fl c
 > >-.Op Fl l
 > >-.Op Fl h | k | m | B Ar blocksize
 > >-.Op Fl n
 > >-.Op Fl x
 > >+.Op Fl a | s | d Ar depth
 > >+.Op Fl B Ar blocksize
 > >.Op Fl I Ar mask
 > >+.Op Fl t Ar threshold
 > >.Op Ar
 > >.Sh DESCRIPTION
 > >The
 > >@@ -61,11 +58,13 @@ The options are as follows:
 > >Display the apparent size instead of the disk usage.
 > >This can be helpful when operating on compressed volumes or sparse files.
 > >.It Fl B Ar blocksize
 > >-Calculate block counts in
 > >+Calculate block count in
 > 
 > I think this is incorrect.  Block counts are computed for all path 
 > arguments given to du(1).  (Even if it was just "block count", it would 
 > need to be "the block count".)
 > 
 > >.Ar blocksize
 > >byte blocks.
 > >This is different from the
 > >-.Fl k, m
 > >+.Fl h, k
 > >+and
 > >+.Fl  m
 > >options or setting
 > >.Ev BLOCKSIZE
 > >and gives an estimate of how much space the examined file hierarchy would
 > >@@ -79,20 +78,45 @@ is rounded up to the next multiple of 512.
 > >.It Fl H
 > >Symbolic links on the command line are followed, symbolic links in file
 > >hierarchies are not followed.
 > >-.It Fl L
 > >-Symbolic links on the command line and in file hierarchies are followed.
 > >.It Fl I Ar mask
 > >Ignore files and directories matching the specified
 > >.Ar mask .
 > >+.It Fl L
 > >+Symbolic links on the command line and in file hierarchies are followed.
 > >.It Fl P
 > >No symbolic links are followed.
 > >This is the default.
 > >.It Fl a
 > >Display an entry for each file in a file hierarchy.
 > >+.It Fl c
 > >+Display a grand total.
 > >+.It Fl d Ar depth
 > >+Display an entry for all files and directories
 > >+.Ar depth
 > >+directories deep.
 > >.It Fl h
 > >"Human-readable" output.
 > >Use unit suffixes: Byte, Kilobyte, Megabyte,
 > >Gigabyte, Terabyte and Petabyte.
 > >+.It Fl k
 > >+Display block count in 1024-byte (1-Kbyte) blocks.
 > 
 > Likewise here.
 > 
 > >+.It Fl l
 > >+If a file has multiple hard links, count its size many times.
 > 
 > I would probably s/many/multiple/ to make the parallelism clear.
 > 
 > >+The default behavior of
 > >+.Nm
 > >+is to count files with multiple hard links only once.
 > >+When the
 > >+.Fl l
 > >+option is specified, the hard link checks are disabled, and these files
 > >+are counted (and displayed) as many times as they are found.
 > 
 > Could use .Pq, I suppose.
 > 
 > >+.It Fl m
 > >+Display block count in 1048576-byte (1-Mbyte) blocks.
 > 
 > block counts, again.
 > (and .Pq)
 > 
 > (Is moving a block of text around in the same commit as changing it 
 > actually a good idea?)
 > 
 > >+.It Fl n
 > >+Ignore files and directories with user
 > >+.Dq nodump
 > >+flag
 > >+.Pq Dv UF_NODUMP
 > >+set.
 > >.It Fl r
 > >Generate messages about directories that cannot be read, files
 > >that cannot be opened, and so on.
 > [the block that got moved]
 > >@@ -152,26 +151,33 @@ If either the
 > >.Fl H
 > >or
 > >.Fl L
 > >-options are specified, storage used by any symbolic links which are
 > >-followed is not counted or displayed.
 > >+option is specified, storage used by any symbolic links which are
 > >+followed is not counted (or displayed).
 > >+.Pp
 > >+The
 > >+.Fl h, k
 > >+and
 > >+.Fl m
 > >+options all override each other; the last one specified determines
 > >+the block count used.
 > >.Sh ENVIRONMENT
 > >.Bl -tag -width BLOCKSIZE
 > >.It Ev BLOCKSIZE
 > >If the environment variable
 > >.Ev BLOCKSIZE
 > >is set, and the
 > >-.Fl k, m
 > >+.Fl h, k
 > >or
 > >-.Fl h
 > >-options are not specified, the block counts will be displayed in units of
 > >+.Fl m
 > >+options are not specified, the block count will be displayed in units of
 > 
 > counts again
 > 
 > 
 > Thanks for spotting the style issues.
 
 thanks for looking at my patch. i'll try to fix all those issues you mentioned
 and will submit a followup patch.
 
 cheers.
 alex
 
 > 
 > -Ben Kaduk
 > 
 > 
 > >that block size.
 > >If
 > >.Ev BLOCKSIZE
 > >is not set, and the
 > >-.Fl k, m
 > >+.Fl h, k
 > >or
 > >-.Fl h
 > >-options are not specified, the block counts will be displayed in 512-byte
 > >+.Fl m
 > >+options are not specified, the block count will be displayed in 512-byte
 > >blocks.
 > >.El
 > >.Sh SEE ALSO
 > >
 > >
 > >>Release-Note:
 > >>Audit-Trail:
 > >>Unformatted:
 > >_______________________________________________
 > >freebsd-doc@freebsd.org mailing list
 > >http://lists.freebsd.org/mailman/listinfo/freebsd-doc
 > >To unsubscribe, send any mail to "freebsd-doc-unsubscribe@freebsd.org"
 > >

From: Alexander Best <arundel@freebsd.org>
To: Benjamin Kaduk <kaduk@mit.edu>
Cc: freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: docs/162438: du(1) man page improvements
Date: Thu, 10 Nov 2011 21:38:50 +0000

 --7AUc2qLy4jB3hD7Z
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 here's an updated version of the patch. could you check, if i missed anything?
 
 i didn't include .Pq macros, since i find "(" and ")" much easier to handle and
 believe macros should only be used in places, where it's really necessary to do
 so.
 
 cheers.
 alex
 
 --7AUc2qLy4jB3hD7Z
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="du.1.diff2"
 
 diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
 index ef8b5ac..3846f6b 100644
 --- a/usr.bin/du/du.1
 +++ b/usr.bin/du/du.1
 @@ -28,7 +28,7 @@
  .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
  .\" $FreeBSD$
  .\"
 -.Dd November 6, 2008
 +.Dd November 10, 2011
  .Dt DU 1
  .Os
  .Sh NAME
 @@ -36,15 +36,12 @@
  .Nd display disk usage statistics
  .Sh SYNOPSIS
  .Nm
 -.Op Fl A
 +.Op Fl Achklmnx
  .Op Fl H | L | P
 -.Op Fl a | s | d Ar depth | Fl t Ar threshold
 -.Op Fl c
 -.Op Fl l
 -.Op Fl h | k | m | B Ar blocksize
 -.Op Fl n
 -.Op Fl x
 +.Op Fl a | s | d Ar depth
 +.Op Fl B Ar blocksize
  .Op Fl I Ar mask
 +.Op Fl t Ar threshold
  .Op Ar
  .Sh DESCRIPTION
  The
 @@ -65,7 +62,9 @@ Calculate block counts in
  .Ar blocksize
  byte blocks.
  This is different from the
 -.Fl k, m
 +.Fl h, k
 +and
 +.Fl  m
  options or setting
  .Ev BLOCKSIZE
  and gives an estimate of how much space the examined file hierarchy would
 @@ -79,48 +78,30 @@ is rounded up to the next multiple of 512.
  .It Fl H
  Symbolic links on the command line are followed, symbolic links in file
  hierarchies are not followed.
 -.It Fl L
 -Symbolic links on the command line and in file hierarchies are followed.
  .It Fl I Ar mask
  Ignore files and directories matching the specified
  .Ar mask .
 +.It Fl L
 +Symbolic links on the command line and in file hierarchies are followed.
  .It Fl P
  No symbolic links are followed.
  This is the default.
  .It Fl a
  Display an entry for each file in a file hierarchy.
 -.It Fl h
 -"Human-readable" output.
 -Use unit suffixes: Byte, Kilobyte, Megabyte,
 -Gigabyte, Terabyte and Petabyte.
 -.It Fl r
 -Generate messages about directories that cannot be read, files
 -that cannot be opened, and so on.
 -This is the default case.
 -This option exists solely for conformance with
 -.St -xpg4 .
 -.It Fl s
 -Display an entry for each specified file.
 -(Equivalent to
 -.Fl d Li 0 )
 -.It Fl t Ar threshold
 -Display only entries for which size exceeds
 -.Ar threshold .
 -If
 -.Ar threshold
 -is negative, display only entries for which size is less than the absolute
 -value of
 -.Ar threshold .
 +.It Fl c
 +Display a grand total.
  .It Fl d Ar depth
  Display an entry for all files and directories
  .Ar depth
  directories deep.
 -.It Fl c
 -Display a grand total.
 +.It Fl h
 +"Human-readable" output.
 +Use unit suffixes: Byte, Kilobyte, Megabyte,
 +Gigabyte, Terabyte and Petabyte.
  .It Fl k
  Display block counts in 1024-byte (1-Kbyte) blocks.
  .It Fl l
 -If a file has multiple hard links, count its size many times.
 +If a file has multiple hard links, count its size multiple times.
  The default behavior of
  .Nm
  is to count files with multiple hard links only once.
 @@ -136,6 +117,24 @@ Ignore files and directories with user
  flag
  .Pq Dv UF_NODUMP
  set.
 +.It Fl r
 +Generate messages about directories that cannot be read, files
 +that cannot be opened, and so on.
 +This is the default case.
 +This option exists solely for conformance with
 +.St -xpg4 .
 +.It Fl s
 +Display an entry for each specified file.
 +(Equivalent to
 +.Fl d Li 0 )
 +.It Fl t Ar threshold
 +Display only entries for which size exceeds
 +.Ar threshold .
 +If
 +.Ar threshold
 +is negative, display only entries for which size is less than the absolute
 +value of
 +.Ar threshold .
  .It Fl x
  File system mount points are not traversed.
  .El
 @@ -152,25 +151,32 @@ If either the
  .Fl H
  or
  .Fl L
 -options are specified, storage used by any symbolic links which are
 -followed is not counted or displayed.
 +option is specified, storage used by any symbolic links which are
 +followed is not counted (or displayed).
 +.Pp
 +The
 +.Fl h, k
 +and
 +.Fl m
 +options all override each other; the last one specified determines
 +the block counts used.
  .Sh ENVIRONMENT
  .Bl -tag -width BLOCKSIZE
  .It Ev BLOCKSIZE
  If the environment variable
  .Ev BLOCKSIZE
  is set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in units of
  that block size.
  If
  .Ev BLOCKSIZE
  is not set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in 512-byte
  blocks.
  .El
 
 --7AUc2qLy4jB3hD7Z--

From: Benjamin Kaduk <kaduk@mit.edu>
To: Alexander Best <arundel@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org, freebsd-doc@freebsd.org
Subject: Re: docs/162438: du(1) man page improvements
Date: Thu, 10 Nov 2011 16:22:28 -0500 (EST)

 On Thu, 10 Nov 2011, Alexander Best wrote:
 
 > Patch attached with submission follows:
 >
 > diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
 > index ef8b5ac..960be23 100644
 > --- a/usr.bin/du/du.1
 > +++ b/usr.bin/du/du.1
 > @@ -28,7 +28,7 @@
 > .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
 > .\" $FreeBSD$
 > .\"
 > -.Dd November 6, 2008
 > +.Dd November 10, 2011
 > .Dt DU 1
 > .Os
 > .Sh NAME
 > @@ -36,15 +36,12 @@
 > .Nd display disk usage statistics
 > .Sh SYNOPSIS
 > .Nm
 > -.Op Fl A
 > +.Op Fl Achklmnx
 > .Op Fl H | L | P
 > -.Op Fl a | s | d Ar depth | Fl t Ar threshold
 > -.Op Fl c
 > -.Op Fl l
 > -.Op Fl h | k | m | B Ar blocksize
 > -.Op Fl n
 > -.Op Fl x
 > +.Op Fl a | s | d Ar depth
 > +.Op Fl B Ar blocksize
 > .Op Fl I Ar mask
 > +.Op Fl t Ar threshold
 > .Op Ar
 > .Sh DESCRIPTION
 > The
 > @@ -61,11 +58,13 @@ The options are as follows:
 > Display the apparent size instead of the disk usage.
 > This can be helpful when operating on compressed volumes or sparse files.
 > .It Fl B Ar blocksize
 > -Calculate block counts in
 > +Calculate block count in
 
 I think this is incorrect.  Block counts are computed for all path 
 arguments given to du(1).  (Even if it was just "block count", it would 
 need to be "the block count".)
 
 > .Ar blocksize
 > byte blocks.
 > This is different from the
 > -.Fl k, m
 > +.Fl h, k
 > +and
 > +.Fl  m
 > options or setting
 > .Ev BLOCKSIZE
 > and gives an estimate of how much space the examined file hierarchy would
 > @@ -79,20 +78,45 @@ is rounded up to the next multiple of 512.
 > .It Fl H
 > Symbolic links on the command line are followed, symbolic links in file
 > hierarchies are not followed.
 > -.It Fl L
 > -Symbolic links on the command line and in file hierarchies are followed.
 > .It Fl I Ar mask
 > Ignore files and directories matching the specified
 > .Ar mask .
 > +.It Fl L
 > +Symbolic links on the command line and in file hierarchies are followed.
 > .It Fl P
 > No symbolic links are followed.
 > This is the default.
 > .It Fl a
 > Display an entry for each file in a file hierarchy.
 > +.It Fl c
 > +Display a grand total.
 > +.It Fl d Ar depth
 > +Display an entry for all files and directories
 > +.Ar depth
 > +directories deep.
 > .It Fl h
 > "Human-readable" output.
 > Use unit suffixes: Byte, Kilobyte, Megabyte,
 > Gigabyte, Terabyte and Petabyte.
 > +.It Fl k
 > +Display block count in 1024-byte (1-Kbyte) blocks.
 
 Likewise here.
 
 > +.It Fl l
 > +If a file has multiple hard links, count its size many times.
 
 I would probably s/many/multiple/ to make the parallelism clear.
 
 > +The default behavior of
 > +.Nm
 > +is to count files with multiple hard links only once.
 > +When the
 > +.Fl l
 > +option is specified, the hard link checks are disabled, and these files
 > +are counted (and displayed) as many times as they are found.
 
 Could use .Pq, I suppose.
 
 > +.It Fl m
 > +Display block count in 1048576-byte (1-Mbyte) blocks.
 
 block counts, again.
 (and .Pq)
 
 (Is moving a block of text around in the same commit as changing it 
 actually a good idea?)
 
 > +.It Fl n
 > +Ignore files and directories with user
 > +.Dq nodump
 > +flag
 > +.Pq Dv UF_NODUMP
 > +set.
 > .It Fl r
 > Generate messages about directories that cannot be read, files
 > that cannot be opened, and so on.
 [the block that got moved]
 > @@ -152,26 +151,33 @@ If either the
 > .Fl H
 > or
 > .Fl L
 > -options are specified, storage used by any symbolic links which are
 > -followed is not counted or displayed.
 > +option is specified, storage used by any symbolic links which are
 > +followed is not counted (or displayed).
 > +.Pp
 > +The
 > +.Fl h, k
 > +and
 > +.Fl m
 > +options all override each other; the last one specified determines
 > +the block count used.
 > .Sh ENVIRONMENT
 > .Bl -tag -width BLOCKSIZE
 > .It Ev BLOCKSIZE
 > If the environment variable
 > .Ev BLOCKSIZE
 > is set, and the
 > -.Fl k, m
 > +.Fl h, k
 > or
 > -.Fl h
 > -options are not specified, the block counts will be displayed in units of
 > +.Fl m
 > +options are not specified, the block count will be displayed in units of
 
 counts again
 
 
 Thanks for spotting the style issues.
 
 -Ben Kaduk
 
 
 > that block size.
 > If
 > .Ev BLOCKSIZE
 > is not set, and the
 > -.Fl k, m
 > +.Fl h, k
 > or
 > -.Fl h
 > -options are not specified, the block counts will be displayed in 512-byte
 > +.Fl m
 > +options are not specified, the block count will be displayed in 512-byte
 > blocks.
 > .El
 > .Sh SEE ALSO
 >
 >
 >> Release-Note:
 >> Audit-Trail:
 >> Unformatted:
 > _______________________________________________
 > freebsd-doc@freebsd.org mailing list
 > http://lists.freebsd.org/mailman/listinfo/freebsd-doc
 > To unsubscribe, send any mail to "freebsd-doc-unsubscribe@freebsd.org"
 >

From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Alexander Best <arundel@freebsd.org>
Cc: freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: docs/162438: du(1) man page improvements
Date: Thu, 10 Nov 2011 22:30:05 -0500 (EST)

 On Thu, 10 Nov 2011, Alexander Best wrote:
 
 > here's an updated version of the patch. could you check, if i missed anything?
 >
 > i didn't include .Pq macros, since i find "(" and ")" much easier to 
 > handle and believe macros should only be used in places, where it's 
 > really necessary to do so.
 
 That's fair.  I think there is reason to prefer .Dq to literal '"', 
 though, which I missed the first time around -- it uses "pretty" quotes, 
 i.e.
 .Dq text
 becomes
 ``text''
 
 > diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
 > index ef8b5ac..3846f6b 100644
 > --- a/usr.bin/du/du.1
 > +++ b/usr.bin/du/du.1
 > @@ -79,48 +78,30 @@ is rounded up to the next multiple of 512.
 >  .It Fl H
 >  Symbolic links on the command line are followed, symbolic links in file
 >  hierarchies are not followed.
 > -.It Fl L
 > -Symbolic links on the command line and in file hierarchies are followed.
 >  .It Fl I Ar mask
 >  Ignore files and directories matching the specified
 >  .Ar mask .
 > +.It Fl L
 > +Symbolic links on the command line and in file hierarchies are followed.
 >  .It Fl P
 >  No symbolic links are followed.
 >  This is the default.
 >  .It Fl a
 >  Display an entry for each file in a file hierarchy.
 > -.It Fl h
 > -"Human-readable" output.
 > -Use unit suffixes: Byte, Kilobyte, Megabyte,
 > -Gigabyte, Terabyte and Petabyte.
 > -.It Fl r
 > -Generate messages about directories that cannot be read, files
 > -that cannot be opened, and so on.
 > -This is the default case.
 > -This option exists solely for conformance with
 > -.St -xpg4 .
 > -.It Fl s
 > -Display an entry for each specified file.
 > -(Equivalent to
 > -.Fl d Li 0 )
 > -.It Fl t Ar threshold
 > -Display only entries for which size exceeds
 > -.Ar threshold .
 > -If
 > -.Ar threshold
 > -is negative, display only entries for which size is less than the absolute
 > -value of
 > -.Ar threshold .
 > +.It Fl c
 > +Display a grand total.
 >  .It Fl d Ar depth
 >  Display an entry for all files and directories
 >  .Ar depth
 >  directories deep.
 > -.It Fl c
 > -Display a grand total.
 > +.It Fl h
 > +"Human-readable" output.
 
 So this would become:
 .Dq Human-readable
 output.
 (Just stuff you reordered, I know, but while we're here ...)
 
 -Ben
 
 
 > +Use unit suffixes: Byte, Kilobyte, Megabyte,
 > +Gigabyte, Terabyte and Petabyte.
 >  .It Fl k
 >  Display block counts in 1024-byte (1-Kbyte) blocks.
 >  .It Fl l
 > -If a file has multiple hard links, count its size many times.
 > +If a file has multiple hard links, count its size multiple times.
 >  The default behavior of
 >  .Nm
 >  is to count files with multiple hard links only once.

From: Alexander Best <arundel@freebsd.org>
To: Benjamin Kaduk <kaduk@MIT.EDU>
Cc: freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: docs/162438: du(1) man page improvements
Date: Fri, 11 Nov 2011 11:00:10 +0000

 --XsQoSWH+UP9D9v3l
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 here's another revised version of my patch. this now also includes changes
 to du.c:usage() to reflect the man page changes.
 
 cheers.
 alex
 
 --XsQoSWH+UP9D9v3l
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="du.1.diff3"
 
 diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
 index ef8b5ac..66bdefe 100644
 --- a/usr.bin/du/du.1
 +++ b/usr.bin/du/du.1
 @@ -28,7 +28,7 @@
  .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
  .\" $FreeBSD$
  .\"
 -.Dd November 6, 2008
 +.Dd November 11, 2011
  .Dt DU 1
  .Os
  .Sh NAME
 @@ -36,15 +36,12 @@
  .Nd display disk usage statistics
  .Sh SYNOPSIS
  .Nm
 -.Op Fl A
 +.Op Fl Achklmnx
  .Op Fl H | L | P
 -.Op Fl a | s | d Ar depth | Fl t Ar threshold
 -.Op Fl c
 -.Op Fl l
 -.Op Fl h | k | m | B Ar blocksize
 -.Op Fl n
 -.Op Fl x
 +.Op Fl a | s | d Ar depth
 +.Op Fl B Ar blocksize
  .Op Fl I Ar mask
 +.Op Fl t Ar threshold
  .Op Ar
  .Sh DESCRIPTION
  The
 @@ -65,7 +62,9 @@ Calculate block counts in
  .Ar blocksize
  byte blocks.
  This is different from the
 -.Fl k, m
 +.Fl h, k
 +and
 +.Fl  m
  options or setting
  .Ev BLOCKSIZE
  and gives an estimate of how much space the examined file hierarchy would
 @@ -79,48 +78,31 @@ is rounded up to the next multiple of 512.
  .It Fl H
  Symbolic links on the command line are followed, symbolic links in file
  hierarchies are not followed.
 -.It Fl L
 -Symbolic links on the command line and in file hierarchies are followed.
  .It Fl I Ar mask
  Ignore files and directories matching the specified
  .Ar mask .
 +.It Fl L
 +Symbolic links on the command line and in file hierarchies are followed.
  .It Fl P
  No symbolic links are followed.
  This is the default.
  .It Fl a
  Display an entry for each file in a file hierarchy.
 -.It Fl h
 -"Human-readable" output.
 -Use unit suffixes: Byte, Kilobyte, Megabyte,
 -Gigabyte, Terabyte and Petabyte.
 -.It Fl r
 -Generate messages about directories that cannot be read, files
 -that cannot be opened, and so on.
 -This is the default case.
 -This option exists solely for conformance with
 -.St -xpg4 .
 -.It Fl s
 -Display an entry for each specified file.
 -(Equivalent to
 -.Fl d Li 0 )
 -.It Fl t Ar threshold
 -Display only entries for which size exceeds
 -.Ar threshold .
 -If
 -.Ar threshold
 -is negative, display only entries for which size is less than the absolute
 -value of
 -.Ar threshold .
 +.It Fl c
 +Display a grand total.
  .It Fl d Ar depth
  Display an entry for all files and directories
  .Ar depth
  directories deep.
 -.It Fl c
 -Display a grand total.
 +.It Fl h
 +.Dq Human-readable
 +output.
 +Use unit suffixes: Byte, Kilobyte, Megabyte,
 +Gigabyte, Terabyte and Petabyte.
  .It Fl k
  Display block counts in 1024-byte (1-Kbyte) blocks.
  .It Fl l
 -If a file has multiple hard links, count its size many times.
 +If a file has multiple hard links, count its size multiple times.
  The default behavior of
  .Nm
  is to count files with multiple hard links only once.
 @@ -136,6 +118,24 @@ Ignore files and directories with user
  flag
  .Pq Dv UF_NODUMP
  set.
 +.It Fl r
 +Generate messages about directories that cannot be read, files
 +that cannot be opened, and so on.
 +This is the default case.
 +This option exists solely for conformance with
 +.St -xpg4 .
 +.It Fl s
 +Display an entry for each specified file.
 +(Equivalent to
 +.Fl d Li 0 )
 +.It Fl t Ar threshold
 +Display only entries for which size exceeds
 +.Ar threshold .
 +If
 +.Ar threshold
 +is negative, display only entries for which size is less than the absolute
 +value of
 +.Ar threshold .
  .It Fl x
  File system mount points are not traversed.
  .El
 @@ -152,25 +152,32 @@ If either the
  .Fl H
  or
  .Fl L
 -options are specified, storage used by any symbolic links which are
 -followed is not counted or displayed.
 +option is specified, storage used by any symbolic links which are
 +followed is not counted (or displayed).
 +.Pp
 +The
 +.Fl h, k
 +and
 +.Fl m
 +options all override each other; the last one specified determines
 +the block counts used.
  .Sh ENVIRONMENT
  .Bl -tag -width BLOCKSIZE
  .It Ev BLOCKSIZE
  If the environment variable
  .Ev BLOCKSIZE
  is set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in units of
  that block size.
  If
  .Ev BLOCKSIZE
  is not set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in 512-byte
  blocks.
  .El
 diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
 index 5c670d4..2dfd05b 100644
 --- a/usr.bin/du/du.c
 +++ b/usr.bin/du/du.c
 @@ -499,9 +499,8 @@ static void
  usage(void)
  {
  	(void)fprintf(stderr,
 -		"usage: du [-A] [-H | -L | -P] [-a | -s | -d depth] [-c] "
 -		"[-l] [-h | -k | -m | -B bsize] [-n] [-x] [-I mask] "
 -		"[file ...]\n");
 +		"usage: du [-Achklmnx] [-H | -L | -P] [-a | -s | -d depth] "
 +		"[-B blocksize] [-I mask] [-t threshold] [file ...]\n");
  	exit(EX_USAGE);
  }
  
 
 --XsQoSWH+UP9D9v3l--

From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Alexander Best <arundel@freebsd.org>
Cc: freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: docs/162438: du(1) man page improvements
Date: Fri, 11 Nov 2011 11:14:11 -0500 (EST)

 On Fri, 11 Nov 2011, Alexander Best wrote:
 
 > here's another revised version of my patch. this now also includes changes
 > to du.c:usage() to reflect the man page changes.
 
 Looks okay to me -- thanks.
 
 -Ben

From: Alexander Best <arundel@freebsd.org>
To: Benjamin Kaduk <kaduk@MIT.EDU>
Cc: freebsd-doc@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: docs/162438: du(1) man page improvements
Date: Sun, 13 Nov 2011 01:09:51 +0000

 On Fri Nov 11 11, Benjamin Kaduk wrote:
 > On Fri, 11 Nov 2011, Alexander Best wrote:
 > 
 > >here's another revised version of my patch. this now also includes changes
 > >to du.c:usage() to reflect the man page changes.
 > 
 > Looks okay to me -- thanks.
 
 good to hear. now we need somebody to commit this. ;)
 
 > 
 > -Ben
Responsible-Changed-From-To: freebsd-doc->gjb 
Responsible-Changed-By: gjb 
Responsible-Changed-When: Mon Nov 14 14:26:24 UTC 2011 
Responsible-Changed-Why:  
I'll take this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=162438 
State-Changed-From-To: open->patched 
State-Changed-By: gjb 
State-Changed-When: Fri Dec 9 02:31:10 UTC 2011 
State-Changed-Why:  
Patched in head (r228356) pending MFC. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=162438 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/162438: commit references a PR
Date: Fri,  9 Dec 2011 02:31:07 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Fri Dec  9 02:30:56 2011
 New Revision: 228356
 URL: http://svn.freebsd.org/changeset/base/228356
 
 Log:
   Update du(1):
   
   - Sort arguments alphabetically where appropriate
   - '-B blocksize' is not mutually exclusive of '-h|-k|-m'
   - Mention '-t' in synopsis
   - Other wording improvements
   - Update usage() output to reflect the new synopsis [1]
   - Other miscellaneous improvements
   
   PR:		162438
   Submitted by:	arundel
   Reviewed by:	Benjamin Kaduk (kaduk ! mit.edu), jhb[1] (original version)
   MFC after:	1 week
 
 Modified:
   head/usr.bin/du/du.1
   head/usr.bin/du/du.c
 
 Modified: head/usr.bin/du/du.1
 ==============================================================================
 --- head/usr.bin/du/du.1	Thu Dec  8 23:58:26 2011	(r228355)
 +++ head/usr.bin/du/du.1	Fri Dec  9 02:30:56 2011	(r228356)
 @@ -28,7 +28,7 @@
  .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
  .\" $FreeBSD$
  .\"
 -.Dd November 6, 2008
 +.Dd December 8, 2011
  .Dt DU 1
  .Os
  .Sh NAME
 @@ -36,15 +36,13 @@
  .Nd display disk usage statistics
  .Sh SYNOPSIS
  .Nm
 -.Op Fl A
 +.Op Fl Aclnx
  .Op Fl H | L | P
 -.Op Fl a | s | d Ar depth | Fl t Ar threshold
 -.Op Fl c
 -.Op Fl l
 -.Op Fl h | k | m | B Ar blocksize
 -.Op Fl n
 -.Op Fl x
 +.Op Fl h | k | m
 +.Op Fl a | s | d Ar depth
 +.Op Fl B Ar blocksize
  .Op Fl I Ar mask
 +.Op Fl t Ar threshold
  .Op Ar
  .Sh DESCRIPTION
  The
 @@ -65,7 +63,9 @@ Calculate block counts in
  .Ar blocksize
  byte blocks.
  This is different from the
 -.Fl k, m
 +.Fl h, k
 +and
 +.Fl  m
  options or setting
  .Ev BLOCKSIZE
  and gives an estimate of how much space the examined file hierarchy would
 @@ -79,48 +79,31 @@ is rounded up to the next multiple of 51
  .It Fl H
  Symbolic links on the command line are followed, symbolic links in file
  hierarchies are not followed.
 -.It Fl L
 -Symbolic links on the command line and in file hierarchies are followed.
  .It Fl I Ar mask
  Ignore files and directories matching the specified
  .Ar mask .
 +.It Fl L
 +Symbolic links on the command line and in file hierarchies are followed.
  .It Fl P
  No symbolic links are followed.
  This is the default.
  .It Fl a
  Display an entry for each file in a file hierarchy.
 -.It Fl h
 -"Human-readable" output.
 -Use unit suffixes: Byte, Kilobyte, Megabyte,
 -Gigabyte, Terabyte and Petabyte.
 -.It Fl r
 -Generate messages about directories that cannot be read, files
 -that cannot be opened, and so on.
 -This is the default case.
 -This option exists solely for conformance with
 -.St -xpg4 .
 -.It Fl s
 -Display an entry for each specified file.
 -(Equivalent to
 -.Fl d Li 0 )
 -.It Fl t Ar threshold
 -Display only entries for which size exceeds
 -.Ar threshold .
 -If
 -.Ar threshold
 -is negative, display only entries for which size is less than the absolute
 -value of
 -.Ar threshold .
 +.It Fl c
 +Display a grand total.
  .It Fl d Ar depth
  Display an entry for all files and directories
  .Ar depth
  directories deep.
 -.It Fl c
 -Display a grand total.
 +.It Fl h
 +.Dq Human-readable
 +output.
 +Use unit suffixes: Byte, Kilobyte, Megabyte,
 +Gigabyte, Terabyte and Petabyte.
  .It Fl k
  Display block counts in 1024-byte (1-Kbyte) blocks.
  .It Fl l
 -If a file has multiple hard links, count its size many times.
 +If a file has multiple hard links, count its size multiple times.
  The default behavior of
  .Nm
  is to count files with multiple hard links only once.
 @@ -136,6 +119,24 @@ Ignore files and directories with user
  flag
  .Pq Dv UF_NODUMP
  set.
 +.It Fl r
 +Generate messages about directories that cannot be read, files
 +that cannot be opened, and so on.
 +This is the default case.
 +This option exists solely for conformance with
 +.St -xpg4 .
 +.It Fl s
 +Display an entry for each specified file.
 +(Equivalent to
 +.Fl d Li 0 )
 +.It Fl t Ar threshold
 +Display only entries for which size exceeds
 +.Ar threshold .
 +If
 +.Ar threshold
 +is negative, display only entries for which size is less than the absolute
 +value of
 +.Ar threshold .
  .It Fl x
  File system mount points are not traversed.
  .El
 @@ -152,25 +153,32 @@ If either the
  .Fl H
  or
  .Fl L
 -options are specified, storage used by any symbolic links which are
 -followed is not counted or displayed.
 +option is specified, storage used by any symbolic links which are
 +followed is not counted (or displayed).
 +.Pp
 +The
 +.Fl h, k
 +and
 +.Fl m
 +options all override each other; the last one specified determines
 +the block counts used.
  .Sh ENVIRONMENT
  .Bl -tag -width BLOCKSIZE
  .It Ev BLOCKSIZE
  If the environment variable
  .Ev BLOCKSIZE
  is set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in units of
  that block size.
  If
  .Ev BLOCKSIZE
  is not set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in 512-byte
  blocks.
  .El
 
 Modified: head/usr.bin/du/du.c
 ==============================================================================
 --- head/usr.bin/du/du.c	Thu Dec  8 23:58:26 2011	(r228355)
 +++ head/usr.bin/du/du.c	Fri Dec  9 02:30:56 2011	(r228356)
 @@ -499,9 +499,9 @@ static void
  usage(void)
  {
  	(void)fprintf(stderr,
 -		"usage: du [-A] [-H | -L | -P] [-a | -s | -d depth] [-c] "
 -		"[-l] [-h | -k | -m | -B bsize] [-n] [-x] [-I mask] "
 -		"[file ...]\n");
 +		"usage: du [-Aclnx] [-H | -L | -P] [-h | -k | -m ] "
 +		"[-a | -s | -d depth] [-B blocksize] [-I mask] "
 +		"[-t threshold] [file ...]\n");
  	exit(EX_USAGE);
  }
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/162438: commit references a PR
Date: Mon,  2 Jan 2012 23:43:44 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Mon Jan  2 23:43:16 2012
 New Revision: 229340
 URL: http://svn.freebsd.org/changeset/base/229340
 
 Log:
   MFC r228356:
   
   r228356:
    - Update du(1):
      - Sort arguments alphabetically where appropriate
      - '-B blocksize' is not mutually exclusive of '-h|-k|-m'
      - Mention '-t' in synopsis
      - Other wording improvements
      - Update usage() output to reflect the new synopsis
      - Other miscellaneous improvements
   
   PR:		162438
 
 Modified:
   stable/9/usr.bin/du/du.1
   stable/9/usr.bin/du/du.c
 Directory Properties:
   stable/9/usr.bin/du/   (props changed)
 
 Modified: stable/9/usr.bin/du/du.1
 ==============================================================================
 --- stable/9/usr.bin/du/du.1	Mon Jan  2 23:43:08 2012	(r229339)
 +++ stable/9/usr.bin/du/du.1	Mon Jan  2 23:43:16 2012	(r229340)
 @@ -28,7 +28,7 @@
  .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
  .\" $FreeBSD$
  .\"
 -.Dd November 6, 2008
 +.Dd December 8, 2011
  .Dt DU 1
  .Os
  .Sh NAME
 @@ -36,15 +36,13 @@
  .Nd display disk usage statistics
  .Sh SYNOPSIS
  .Nm
 -.Op Fl A
 +.Op Fl Aclnx
  .Op Fl H | L | P
 -.Op Fl a | s | d Ar depth | Fl t Ar threshold
 -.Op Fl c
 -.Op Fl l
 -.Op Fl h | k | m | B Ar blocksize
 -.Op Fl n
 -.Op Fl x
 +.Op Fl h | k | m
 +.Op Fl a | s | d Ar depth
 +.Op Fl B Ar blocksize
  .Op Fl I Ar mask
 +.Op Fl t Ar threshold
  .Op Ar
  .Sh DESCRIPTION
  The
 @@ -65,7 +63,9 @@ Calculate block counts in
  .Ar blocksize
  byte blocks.
  This is different from the
 -.Fl k, m
 +.Fl h, k
 +and
 +.Fl  m
  options or setting
  .Ev BLOCKSIZE
  and gives an estimate of how much space the examined file hierarchy would
 @@ -79,48 +79,31 @@ is rounded up to the next multiple of 51
  .It Fl H
  Symbolic links on the command line are followed, symbolic links in file
  hierarchies are not followed.
 -.It Fl L
 -Symbolic links on the command line and in file hierarchies are followed.
  .It Fl I Ar mask
  Ignore files and directories matching the specified
  .Ar mask .
 +.It Fl L
 +Symbolic links on the command line and in file hierarchies are followed.
  .It Fl P
  No symbolic links are followed.
  This is the default.
  .It Fl a
  Display an entry for each file in a file hierarchy.
 -.It Fl h
 -"Human-readable" output.
 -Use unit suffixes: Byte, Kilobyte, Megabyte,
 -Gigabyte, Terabyte and Petabyte.
 -.It Fl r
 -Generate messages about directories that cannot be read, files
 -that cannot be opened, and so on.
 -This is the default case.
 -This option exists solely for conformance with
 -.St -xpg4 .
 -.It Fl s
 -Display an entry for each specified file.
 -(Equivalent to
 -.Fl d Li 0 )
 -.It Fl t Ar threshold
 -Display only entries for which size exceeds
 -.Ar threshold .
 -If
 -.Ar threshold
 -is negative, display only entries for which size is less than the absolute
 -value of
 -.Ar threshold .
 +.It Fl c
 +Display a grand total.
  .It Fl d Ar depth
  Display an entry for all files and directories
  .Ar depth
  directories deep.
 -.It Fl c
 -Display a grand total.
 +.It Fl h
 +.Dq Human-readable
 +output.
 +Use unit suffixes: Byte, Kilobyte, Megabyte,
 +Gigabyte, Terabyte and Petabyte.
  .It Fl k
  Display block counts in 1024-byte (1-Kbyte) blocks.
  .It Fl l
 -If a file has multiple hard links, count its size many times.
 +If a file has multiple hard links, count its size multiple times.
  The default behavior of
  .Nm
  is to count files with multiple hard links only once.
 @@ -136,6 +119,24 @@ Ignore files and directories with user
  flag
  .Pq Dv UF_NODUMP
  set.
 +.It Fl r
 +Generate messages about directories that cannot be read, files
 +that cannot be opened, and so on.
 +This is the default case.
 +This option exists solely for conformance with
 +.St -xpg4 .
 +.It Fl s
 +Display an entry for each specified file.
 +(Equivalent to
 +.Fl d Li 0 )
 +.It Fl t Ar threshold
 +Display only entries for which size exceeds
 +.Ar threshold .
 +If
 +.Ar threshold
 +is negative, display only entries for which size is less than the absolute
 +value of
 +.Ar threshold .
  .It Fl x
  File system mount points are not traversed.
  .El
 @@ -152,25 +153,32 @@ If either the
  .Fl H
  or
  .Fl L
 -options are specified, storage used by any symbolic links which are
 -followed is not counted or displayed.
 +option is specified, storage used by any symbolic links which are
 +followed is not counted (or displayed).
 +.Pp
 +The
 +.Fl h, k
 +and
 +.Fl m
 +options all override each other; the last one specified determines
 +the block counts used.
  .Sh ENVIRONMENT
  .Bl -tag -width BLOCKSIZE
  .It Ev BLOCKSIZE
  If the environment variable
  .Ev BLOCKSIZE
  is set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in units of
  that block size.
  If
  .Ev BLOCKSIZE
  is not set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in 512-byte
  blocks.
  .El
 
 Modified: stable/9/usr.bin/du/du.c
 ==============================================================================
 --- stable/9/usr.bin/du/du.c	Mon Jan  2 23:43:08 2012	(r229339)
 +++ stable/9/usr.bin/du/du.c	Mon Jan  2 23:43:16 2012	(r229340)
 @@ -507,9 +507,9 @@ static void
  usage(void)
  {
  	(void)fprintf(stderr,
 -		"usage: du [-A] [-H | -L | -P] [-a | -s | -d depth] [-c] "
 -		"[-l] [-h | -k | -m | -B bsize] [-n] [-x] [-I mask] "
 -		"[file ...]\n");
 +		"usage: du [-Aclnx] [-H | -L | -P] [-h | -k | -m ] "
 +		"[-a | -s | -d depth] [-B blocksize] [-I mask] "
 +		"[-t threshold] [file ...]\n");
  	exit(EX_USAGE);
  }
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/162438: commit references a PR
Date: Mon,  2 Jan 2012 23:44:19 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Mon Jan  2 23:44:07 2012
 New Revision: 229343
 URL: http://svn.freebsd.org/changeset/base/229343
 
 Log:
   MFC r210993, r228356:
   
   r210933 (joel):
    - Fix typos and spelling mistakes
   
   r228356: [3]
    - Update du(1):
      - Sort arguments alphabetically where appropriate
      - '-B blocksize' is not mutually exclusive of '-h|-k|-m'
      - Mention '-t' in synopsis
      - Other wording improvements
      - Update usage() output to reflect the new synopsis
      - Other miscellaneous improvements
   
   PR:             162438 [3]
 
 Modified:
   stable/8/usr.bin/du/du.1
   stable/8/usr.bin/du/du.c
 Directory Properties:
   stable/8/usr.bin/du/   (props changed)
 
 Modified: stable/8/usr.bin/du/du.1
 ==============================================================================
 --- stable/8/usr.bin/du/du.1	Mon Jan  2 23:43:45 2012	(r229342)
 +++ stable/8/usr.bin/du/du.1	Mon Jan  2 23:44:07 2012	(r229343)
 @@ -32,7 +32,7 @@
  .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
  .\" $FreeBSD$
  .\"
 -.Dd November 6, 2008
 +.Dd December 8, 2011
  .Dt DU 1
  .Os
  .Sh NAME
 @@ -40,15 +40,13 @@
  .Nd display disk usage statistics
  .Sh SYNOPSIS
  .Nm
 -.Op Fl A
 +.Op Fl Aclnx
  .Op Fl H | L | P
 -.Op Fl a | s | d Ar depth | Fl t Ar threshold
 -.Op Fl c
 -.Op Fl l
 -.Op Fl h | k | m | B Ar blocksize
 -.Op Fl n
 -.Op Fl x
 +.Op Fl h | k | m
 +.Op Fl a | s | d Ar depth
 +.Op Fl B Ar blocksize
  .Op Fl I Ar mask
 +.Op Fl t Ar threshold
  .Op Ar
  .Sh DESCRIPTION
  The
 @@ -69,10 +67,12 @@ Calculate block counts in
  .Ar blocksize
  byte blocks.
  This is different from the
 -.Fl k, m
 +.Fl h, k
 +and
 +.Fl  m
  options or setting
  .Ev BLOCKSIZE
 -and gives an estimate of how much space the examined file hierachy would
 +and gives an estimate of how much space the examined file hierarchy would
  require on a filesystem with the given
  .Ar blocksize .
  Unless in
 @@ -83,48 +83,31 @@ is rounded up to the next multiple of 51
  .It Fl H
  Symbolic links on the command line are followed, symbolic links in file
  hierarchies are not followed.
 -.It Fl L
 -Symbolic links on the command line and in file hierarchies are followed.
  .It Fl I Ar mask
  Ignore files and directories matching the specified
  .Ar mask .
 +.It Fl L
 +Symbolic links on the command line and in file hierarchies are followed.
  .It Fl P
  No symbolic links are followed.
  This is the default.
  .It Fl a
  Display an entry for each file in a file hierarchy.
 -.It Fl h
 -"Human-readable" output.
 -Use unit suffixes: Byte, Kilobyte, Megabyte,
 -Gigabyte, Terabyte and Petabyte.
 -.It Fl r
 -Generate messages about directories that cannot be read, files
 -that cannot be opened, and so on.
 -This is the default case.
 -This option exists solely for conformance with
 -.St -xpg4 .
 -.It Fl s
 -Display an entry for each specified file.
 -(Equivalent to
 -.Fl d Li 0 )
 -.It Fl t Ar threshold
 -Display only entries for which size exceeds
 -.Ar threshold .
 -If
 -.Ar threshold
 -is negative, display only entries for which size is less than the absolute
 -value of
 -.Ar threshold .
 +.It Fl c
 +Display a grand total.
  .It Fl d Ar depth
  Display an entry for all files and directories
  .Ar depth
  directories deep.
 -.It Fl c
 -Display a grand total.
 +.It Fl h
 +.Dq Human-readable
 +output.
 +Use unit suffixes: Byte, Kilobyte, Megabyte,
 +Gigabyte, Terabyte and Petabyte.
  .It Fl k
  Display block counts in 1024-byte (1-Kbyte) blocks.
  .It Fl l
 -If a file has multiple hard links, count its size many times.
 +If a file has multiple hard links, count its size multiple times.
  The default behavior of
  .Nm
  is to count files with multiple hard links only once.
 @@ -140,6 +123,24 @@ Ignore files and directories with user
  flag
  .Pq Dv UF_NODUMP
  set.
 +.It Fl r
 +Generate messages about directories that cannot be read, files
 +that cannot be opened, and so on.
 +This is the default case.
 +This option exists solely for conformance with
 +.St -xpg4 .
 +.It Fl s
 +Display an entry for each specified file.
 +(Equivalent to
 +.Fl d Li 0 )
 +.It Fl t Ar threshold
 +Display only entries for which size exceeds
 +.Ar threshold .
 +If
 +.Ar threshold
 +is negative, display only entries for which size is less than the absolute
 +value of
 +.Ar threshold .
  .It Fl x
  File system mount points are not traversed.
  .El
 @@ -156,25 +157,32 @@ If either the
  .Fl H
  or
  .Fl L
 -options are specified, storage used by any symbolic links which are
 -followed is not counted or displayed.
 +option is specified, storage used by any symbolic links which are
 +followed is not counted (or displayed).
 +.Pp
 +The
 +.Fl h, k
 +and
 +.Fl m
 +options all override each other; the last one specified determines
 +the block counts used.
  .Sh ENVIRONMENT
  .Bl -tag -width BLOCKSIZE
  .It Ev BLOCKSIZE
  If the environment variable
  .Ev BLOCKSIZE
  is set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in units of
  that block size.
  If
  .Ev BLOCKSIZE
  is not set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in 512-byte
  blocks.
  .El
 
 Modified: stable/8/usr.bin/du/du.c
 ==============================================================================
 --- stable/8/usr.bin/du/du.c	Mon Jan  2 23:43:45 2012	(r229342)
 +++ stable/8/usr.bin/du/du.c	Mon Jan  2 23:44:07 2012	(r229343)
 @@ -511,9 +511,9 @@ static void
  usage(void)
  {
  	(void)fprintf(stderr,
 -		"usage: du [-A] [-H | -L | -P] [-a | -s | -d depth] [-c] "
 -		"[-l] [-h | -k | -m | -B bsize] [-n] [-x] [-I mask] "
 -		"[file ...]\n");
 +		"usage: du [-Aclnx] [-H | -L | -P] [-h | -k | -m ] "
 +		"[-a | -s | -d depth] [-B blocksize] [-I mask] "
 +		"[-t threshold] [file ...]\n");
  	exit(EX_USAGE);
  }
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: gjb 
State-Changed-When: Mon Jan 2 23:50:49 UTC 2012 
State-Changed-Why:  
MFC'd to stable/9 and stable/8.  MFC to stable/7 is still pending. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=162438 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/162438: commit references a PR
Date: Sat,  7 Jan 2012 01:39:58 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Sat Jan  7 01:39:38 2012
 New Revision: 229756
 URL: http://svn.freebsd.org/changeset/base/229756
 
 Log:
   MFC r209362, r210933, r228356:
   
   r209362 (brian) [1]:
   - Add a -t switch for masking output that's above or below certain
     thresholds.  This switch makes it a lot easier to locate problem
     areas when a process is threatening to consume all of your disk
     space.
   
   r210933 (joel):
   - Fix typos and spelling mistakes.
   
   r228356 [2]:
   - Update du(1):
   
     - Sort arguments alphabetically where appropriate
     - '-B blocksize' is not mutually exclusive of '-h|-k|-m'
     - Mention '-t' in synopsis
     - Other wording improvements
     - Update usage() output to reflect the new synopsis
     - Other miscellaneous improvements
   
   Approved by:	brian [1]
   PR:		162438 [2]
 
 Modified:
   stable/7/usr.bin/du/du.1
   stable/7/usr.bin/du/du.c
 Directory Properties:
   stable/7/usr.bin/du/   (props changed)
 
 Modified: stable/7/usr.bin/du/du.1
 ==============================================================================
 --- stable/7/usr.bin/du/du.1	Sat Jan  7 01:12:21 2012	(r229755)
 +++ stable/7/usr.bin/du/du.1	Sat Jan  7 01:39:38 2012	(r229756)
 @@ -32,7 +32,7 @@
  .\"	@(#)du.1	8.2 (Berkeley) 4/1/94
  .\" $FreeBSD$
  .\"
 -.Dd November 6, 2008
 +.Dd December 8, 2011
  .Dt DU 1
  .Os
  .Sh NAME
 @@ -40,15 +40,13 @@
  .Nd display disk usage statistics
  .Sh SYNOPSIS
  .Nm
 -.Op Fl A
 +.Op Fl Aclnx
  .Op Fl H | L | P
 +.Op Fl h | k | m
  .Op Fl a | s | d Ar depth
 -.Op Fl c
 -.Op Fl l
 -.Op Fl h | k | m | B Ar blocksize
 -.Op Fl n
 -.Op Fl x
 +.Op Fl B Ar blocksize
  .Op Fl I Ar mask
 +.Op Fl t Ar threshold
  .Op Ar
  .Sh DESCRIPTION
  The
 @@ -69,10 +67,12 @@ Calculate block counts in
  .Ar blocksize
  byte blocks.
  This is different from the
 -.Fl k, m
 +.Fl h, k
 +and
 +.Fl  m
  options or setting
  .Ev BLOCKSIZE
 -and gives an estimate of how much space the examined file hierachy would
 +and gives an estimate of how much space the examined file hierarchy would
  require on a filesystem with the given
  .Ar blocksize .
  Unless in
 @@ -83,40 +83,31 @@ is rounded up to the next multiple of 51
  .It Fl H
  Symbolic links on the command line are followed, symbolic links in file
  hierarchies are not followed.
 -.It Fl L
 -Symbolic links on the command line and in file hierarchies are followed.
  .It Fl I Ar mask
  Ignore files and directories matching the specified
  .Ar mask .
 +.It Fl L
 +Symbolic links on the command line and in file hierarchies are followed.
  .It Fl P
  No symbolic links are followed.
  This is the default.
  .It Fl a
  Display an entry for each file in a file hierarchy.
 -.It Fl h
 -"Human-readable" output.
 -Use unit suffixes: Byte, Kilobyte, Megabyte,
 -Gigabyte, Terabyte and Petabyte.
 -.It Fl r
 -Generate messages about directories that cannot be read, files
 -that cannot be opened, and so on.
 -This is the default case.
 -This option exists solely for conformance with
 -.St -xpg4 .
 -.It Fl s
 -Display an entry for each specified file.
 -(Equivalent to
 -.Fl d Li 0 )
 +.It Fl c
 +Display a grand total.
  .It Fl d Ar depth
  Display an entry for all files and directories
  .Ar depth
  directories deep.
 -.It Fl c
 -Display a grand total.
 +.It Fl h
 +.Dq Human-readable
 +output.
 +Use unit suffixes: Byte, Kilobyte, Megabyte,
 +Gigabyte, Terabyte and Petabyte.
  .It Fl k
  Display block counts in 1024-byte (1-Kbyte) blocks.
  .It Fl l
 -If a file has multiple hard links, count its size many times.
 +If a file has multiple hard links, count its size multiple times.
  The default behavior of
  .Nm
  is to count files with multiple hard links only once.
 @@ -132,6 +123,24 @@ Ignore files and directories with user
  flag
  .Pq Dv UF_NODUMP
  set.
 +.It Fl r
 +Generate messages about directories that cannot be read, files
 +that cannot be opened, and so on.
 +This is the default case.
 +This option exists solely for conformance with
 +.St -xpg4 .
 +.It Fl s
 +Display an entry for each specified file.
 +(Equivalent to
 +.Fl d Li 0 )
 +.It Fl t Ar threshold
 +Display only entries for which size exceeds
 +.Ar threshold .
 +If
 +.Ar threshold
 +is negative, display only entries for which size is less than the absolute
 +value of
 +.Ar threshold .
  .It Fl x
  File system mount points are not traversed.
  .El
 @@ -148,25 +157,32 @@ If either the
  .Fl H
  or
  .Fl L
 -options are specified, storage used by any symbolic links which are
 -followed is not counted or displayed.
 +option is specified, storage used by any symbolic links which are
 +followed is not counted (or displayed).
 +.Pp
 +The
 +.Fl h, k
 +and
 +.Fl m
 +options all override each other; the last one specified determines
 +the block counts used.
  .Sh ENVIRONMENT
  .Bl -tag -width BLOCKSIZE
  .It Ev BLOCKSIZE
  If the environment variable
  .Ev BLOCKSIZE
  is set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in units of
  that block size.
  If
  .Ev BLOCKSIZE
  is not set, and the
 -.Fl k, m
 +.Fl h, k
  or
 -.Fl h
 +.Fl m
  options are not specified, the block counts will be displayed in 512-byte
  blocks.
  .El
 
 Modified: stable/7/usr.bin/du/du.c
 ==============================================================================
 --- stable/7/usr.bin/du/du.c	Sat Jan  7 01:12:21 2012	(r229755)
 +++ stable/7/usr.bin/du/du.c	Sat Jan  7 01:39:38 2012	(r229756)
 @@ -88,6 +88,7 @@ main(int argc, char *argv[])
  	FTS		*fts;
  	FTSENT		*p;
  	off_t		savednumber, curblocks;
 +	off_t		threshold, threshold_sign;
  	int		ftsoptions;
  	int		listall;
  	int		depth;
 @@ -104,12 +105,14 @@ main(int argc, char *argv[])
  	save = argv;
  	ftsoptions = 0;
  	savednumber = 0;
 +	threshold = 0;
 +	threshold_sign = 1;
  	cblocksize = DEV_BSIZE;
  	blocksize = 0;
  	depth = INT_MAX;
  	SLIST_INIT(&ignores);
  
 -	while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrx")) != -1)
 +	while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1)
  		switch (ch) {
  		case 'A':
  			Aflag = 1;
 @@ -177,6 +180,14 @@ main(int argc, char *argv[])
  			break;
  		case 'r':		 /* Compatibility. */
  			break;
 +		case 't' :
 +			if (expand_number(optarg, &threshold) != 0 ||
 +			    threshold == 0) {
 +				warnx("invalid threshold: %s", optarg);
 +				usage();
 +			} else if (threshold < 0)
 +				threshold_sign = -1;
 +			break;
  		case 'x':
  			ftsoptions |= FTS_XDEV;
  			break;
 @@ -246,6 +257,10 @@ main(int argc, char *argv[])
  		blocksize /= DEV_BSIZE;
  	}
  
 +	if (threshold != 0)
 +		threshold = howmany(threshold / DEV_BSIZE * cblocksize,
 +		    blocksize);
 +
  	rval = 0;
  
  	if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL)
 @@ -267,7 +282,9 @@ main(int argc, char *argv[])
  			p->fts_parent->fts_bignum += p->fts_bignum +=
  			    curblocks;
  
 -			if (p->fts_level <= depth) {
 +			if (p->fts_level <= depth && threshold <=
 +			    threshold_sign * howmany(p->fts_bignum *
 +			    cblocksize, blocksize)) {
  				if (hflag) {
  					prthumanval(p->fts_bignum);
  					(void)printf("\t%s\n", p->fts_path);
 @@ -486,9 +503,9 @@ static void
  usage(void)
  {
  	(void)fprintf(stderr,
 -		"usage: du [-A] [-H | -L | -P] [-a | -s | -d depth] [-c] "
 -		"[-l] [-h | -k | -m | -B bsize] [-n] [-x] [-I mask] "
 -		"[file ...]\n");
 +		"usage: du [-Aclnx] [-H | -L | -P] [-h | -k | -m ] "
 +		"[-a | -s | -d depth] [-B blocksize] [-I mask] "
 +		"[-t threshold] [file ...]\n");
  	exit(EX_USAGE);
  }
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
