From 02a79f3336a9587e4e3c18f1a68564240bb2af7f Mon Sep 17 00:00:00 2001 From: apb Date: Thu, 9 Apr 2009 09:53:37 +0000 Subject: [PATCH] * Rewrite intro to mention all three things mtree can do (check directory tree against spec; create spec; modify spec). * Consistently use "options" to refer to command line options. "flags" is used to refer to file flags. * Some other clarifications and changes for consistency. --- usr.sbin/mtree/mtree.8 | 61 +++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8 index 60dbf7cf01dc..f8ef2bee25f5 100644 --- a/usr.sbin/mtree/mtree.8 +++ b/usr.sbin/mtree/mtree.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: mtree.8,v 1.50 2009/04/08 19:39:23 wiz Exp $ +.\" $NetBSD: mtree.8,v 1.51 2009/04/09 09:53:37 apb Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -56,7 +56,7 @@ .\" .\" @(#)mtree.8 8.2 (Berkeley) 12/11/93 .\" -.Dd April 8, 2009 +.Dd April 9, 2009 .Dt MTREE 8 .Os .Sh NAME @@ -79,7 +79,12 @@ .Sh DESCRIPTION The .Nm -utility compares the file hierarchy rooted in the current directory +utility compares a file hierarchy against a specification, +creates a specification for a file hierarchy, or modifies +a specification. +.Pp +The default action, if not overridden by command line options, +is to compare the file hierarchy rooted in the current directory against a specification read from the standard input. Messages are written to the standard output for any files whose characteristics do not match the specification, or which are @@ -88,27 +93,34 @@ missing from either the file hierarchy or the specification. The options are as follows: .Bl -tag -width Xxxexcludexfilexx .It Fl C -Print -.Pq Sq dump -the specification as provided by -.Fl f Ar spec -in a format that's easier to parse with various tools. -The full path name is always printed as the first field, and +Convert a specification into +a format that's easier to parse with various tools. +The input specification is read from standard input or +from the file given by +.Fl f Ar spec . +In the output, each file or directory is represented using a single line +(which might be very long). +The full path name +(beginning with +.Dq \&./ ) +is always printed as the first field; .Fl k , .Fl K , and .Fl R -can be used to control which other keywords are printed, and +can be used to control which other keywords are printed; .Fl E and .Fl I -can be used to control which files are printed. -The +can be used to control which files are printed; .Fl S option can be used to sort the output. .It Fl c Print a specification for the file hierarchy originating at -the current working directory to the standard output. +the current working directory (or the directory provided by +.Fl p Ar path ) +to the standard output. +The output is in a style using relative path names. .It Fl D As per .Fl C , @@ -174,11 +186,11 @@ checks apply only to read, write and execute permissions -- in particular, if other bits like the sticky bit or suid/sgid bits are set either in the specification or the file, exact checking will be performed. -This flag may not be set at the same time as the +This option may not be set at the same time as the .Fl u or .Fl U -flags. +option. .It Fl M Permit merging of specification entries with different types, with the last entry take precedence. @@ -222,13 +234,14 @@ specification. .It Fl S When reading a specification into an internal data structure, sort the entries. -This will affect the order in which the -.Fl c -option checks entries, and the order of the output produced by the +Sorting will affect the order of the output produced by the .Fl C or .Fl D -options. +options, and will also affect the order in which +missing entries are created or reported when a directory tree is checked +against a specification. +.Pp The sort order is the same as that used by the .Fl c option, which is that entries within the same directory are @@ -641,7 +654,7 @@ keyword appeared in .Nx 1.2 . The .Fl U -flag appeared in +option appeared in .Nx 1.3 . The .Sy flags @@ -651,7 +664,7 @@ keywords, and .Fl i and .Fl m -flags +options appeared in .Nx 1.4 . The @@ -673,7 +686,7 @@ keywords, .Fl W , and .Fl X -flags, and support for full paths appeared in +options, and support for full paths appeared in .Nx 1.6 . The .Sy sha256 , @@ -682,3 +695,7 @@ and .Sy sha512 keywords appeared in .Nx 3.0 . +The +.Fl S +option appeared in +.Nx 6.0 .