Module Name:    src
Committed By:   abs
Date:           Tue Nov 20 12:37:29 UTC 2012

Modified Files:
        src/bin/ls: ls.1 ls.c

Log Message:
PR/47167
ls.1:
- Sort options in `SYNOPSIS', the option list, and texts within
  the man page;
- improve wording;
- improve macro usage;
- use more consistency regarding (locations for) information about
  which options override which;
- cross-reference `-d' and `-R';
- simplify description of `-k', removing redundant and unneeded
  information;
- sort entry type list (but leave `-a' and `-A' as they are, given
  their meaning);
- correct / augment description of `BLOCKSIZE' environment variable
  in `ENVIRONMENT' section;
- bump date.

ls.c:
- Sort options in `usage';
- augment comment about when to figure out block size.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/bin/ls/ls.1
cvs rdiff -u -r1.69 -r1.70 src/bin/ls/ls.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/ls/ls.1
diff -u src/bin/ls/ls.1:1.71 src/bin/ls/ls.1:1.72
--- src/bin/ls/ls.1:1.71	Sun Oct 21 08:18:27 2012
+++ src/bin/ls/ls.1	Tue Nov 20 12:37:29 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ls.1,v 1.71 2012/10/21 08:18:27 wiz Exp $
+.\"	$NetBSD: ls.1,v 1.72 2012/11/20 12:37:29 abs Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"     @(#)ls.1	8.7 (Berkeley) 7/29/94
 .\"
-.Dd April 2, 2011
+.Dd November 20, 2012
 .Dt LS 1
 .Os
 .Sh NAME
@@ -40,19 +40,19 @@
 .Nd list directory contents
 .Sh SYNOPSIS
 .Nm
-.Op Fl AaBbCcdFfghikLlMmnopqRrSsTtuWwx1
+.Op Fl 1AaBbCcdFfghikLlMmnopqRrSsTtuWwx
 .Op Ar
 .Sh DESCRIPTION
-For each operand that names a
+For each
 .Ar file
-of a type other than
+operand that names a file of a type other than
 directory,
 .Nm
 displays its name as well as any requested,
 associated information.
-For each operand that names a
+For each
 .Ar file
-of type directory,
+operand that names a file of type directory,
 .Nm
 displays the names of files contained
 within that directory, as well as any requested, associated
@@ -67,6 +67,11 @@ lexicographical order.
 .Pp
 The following options are available:
 .Bl -tag -width indent
+.It Fl \&1
+(The numeric digit
+.Dq one ) .
+Force output to be one entry per line.
+This is the default when output is not to a terminal.
 .It Fl A
 List all entries except for
 .Ql \&.
@@ -88,13 +93,18 @@ but use C escape codes whenever possible
 Force multi-column output; this is the default when output is to a terminal.
 .It Fl c
 Use time when file status was last changed,
-instead of time of last modification of the file for sorting
-.Pq Fl t
-or printing
-.Pq Fl l .
+instead of time of last modification of the file for printing
+.Pq Fl l
+or sorting
+.Pq Fl t .
+Overrides
+.Fl u .
 .It Fl d
 Directories are listed as plain files (not searched recursively) and
 symbolic links in the argument list are not followed.
+Turns off
+.Fl R
+if also given.
 .It Fl F
 Display a slash
 .Pq Sq \&/
@@ -123,9 +133,9 @@ The same as
 except that the owner is not printed.
 .It Fl h
 Modifies the
-.Fl s
-and
 .Fl l
+and
+.Fl s
 options, causing the sizes to be reported in bytes displayed in a human
 readable format.
 Overrides
@@ -138,15 +148,8 @@ For each file, print the file's file ser
 Modifies the
 .Fl s
 option, causing the sizes to be reported in kilobytes.
-The rightmost of the
-.Fl k
-and
-.Fl h
-flags overrides the previous flag.
-See also
-.Fl h
-and
-.Fl M .
+Overrides
+.Fl h .
 .It Fl L
 For each file, if it's a link, evaluate file information and file type
 of the referenced file and not the link itself; however still print
@@ -169,8 +172,8 @@ options, causing the sizes or block coun
 commas (or a locale appropriate separator) resulting in a more readable
 output.
 Overrides
-.Fl h .
-Does not override
+.Fl h ;
+does not override
 .Fl k .
 .It Fl m
 Stream output format; list files across the page, separated by commas.
@@ -201,6 +204,8 @@ the character
 this is the default when output is to a terminal.
 .It Fl R
 Recursively list subdirectories encountered.
+See also
+.Fl d .
 .It Fl r
 Reverse the order of the sort to get reverse
 lexicographical order or the smallest or oldest entries first.
@@ -230,10 +235,12 @@ order.
 .It Fl u
 Use time of last access,
 instead of last modification
-of the file for sorting
-.Pq Fl t
-or printing
-.Pq Fl l .
+of the file for printing
+.Pq Fl l
+or sorting
+.Pq Fl t .
+Overrides
+.Fl c .
 .It Fl W
 Display whiteouts when scanning directories.
 .It Fl w
@@ -241,19 +248,14 @@ Force raw printing of non-printable char
 This is the default when output is not to a terminal.
 .It Fl x
 Multi-column output sorted across the page rather than down the page.
-.It Fl \&1
-(The numeric digit
-.Dq one ) .
-Force output to be one entry per line.
-This is the default when output is not to a terminal.
 .El
 .Pp
 The
 .Fl B ,
 .Fl b ,
-.Fl w ,
+.Fl q ,
 and
-.Fl q
+.Fl w
 options all override each other; the last one specified determines
 the format used for non-printable characters.
 .Pp
@@ -278,13 +280,6 @@ even if
 .Fl g
 was specified last.
 .Pp
-The
-.Fl c
-and
-.Fl u
-options override each other; the last one specified determines
-the file time used.
-.Pp
 By default,
 .Nm
 lists one entry per line to standard
@@ -296,11 +291,11 @@ options are specified.
 .Pp
 File information is displayed with one or more
 .Aq blank
-separating the information associated with the
+characters separating the information associated with the
 .Fl i ,
-.Fl s ,
+.Fl l ,
 and
-.Fl l
+.Fl s
 options.
 .Ss The Long Format
 If the
@@ -333,7 +328,7 @@ pathname
 .El
 .Pp
 In addition, for each directory whose contents are displayed, the total
-number of blocks in units of 512 bytes or
+number of file system blocks in units of 512 bytes or
 .Ev BLOCKSIZE
 (see
 .Sx ENVIRONMENT )
@@ -361,6 +356,8 @@ The entry type character describes the t
 follows:
 .Pp
 .Bl -tag -width 4n -offset indent -compact
+.It Sy \-
+Regular file.
 .It Sy a
 Archive state 1.
 .It Sy A
@@ -373,14 +370,12 @@ Character special file.
 Directory.
 .It Sy l
 Symbolic link.
-.It Sy s
-Socket link.
 .It Sy p
 FIFO.
+.It Sy s
+Socket link.
 .It Sy w
 Whiteout.
-.It Sy \-
-Regular file.
 .El
 .Pp
 The next three fields
@@ -460,11 +455,11 @@ The following environment variables affe
 If the environment variable
 .Ev BLOCKSIZE
 is set, and the
-.Fl h
-and
 .Fl k
-options are not specified, the block counts
+option is not specified, the block counts
 (see
+.Fl l
+and
 .Fl s )
 will be displayed in units of that size block.
 .It Ev COLUMNS

Index: src/bin/ls/ls.c
diff -u src/bin/ls/ls.c:1.69 src/bin/ls/ls.c:1.70
--- src/bin/ls/ls.c:1.69	Mon Aug 29 14:44:21 2011
+++ src/bin/ls/ls.c	Tue Nov 20 12:37:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ls.c,v 1.69 2011/08/29 14:44:21 joerg Exp $	*/
+/*	$NetBSD: ls.c,v 1.70 2012/11/20 12:37:29 abs Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)ls.c	8.7 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: ls.c,v 1.69 2011/08/29 14:44:21 joerg Exp $");
+__RCSID("$NetBSD: ls.c,v 1.70 2012/11/20 12:37:29 abs Exp $");
 #endif
 #endif /* not lint */
 
@@ -117,7 +117,7 @@ usage(void)
 {
 
 	(void)fprintf(stderr,
-	    "usage: %s [-AaBbCcdFfghikLlMmnopqRrSsTtuWwx1] [file ...]\n",
+	    "usage: %s [-1AaBbCcdFfghikLlMmnopqRrSsTtuWwx] [file ...]\n",
 	    getprogname());
 	exit(EXIT_FAILURE);
 	/* NOTREACHED */
@@ -331,7 +331,7 @@ ls_main(int argc, char *argv[])
 		fts_options |= FTS_WHITEOUT;
 #endif
 
-	/* If -l or -s, figure out block size. */
+	/* If -i, -l, or -s, figure out block size. */
 	if (f_inode || f_longform || f_size) {
 		if (!kflag)
 			(void)getbsize(NULL, &blocksize);

Reply via email to