Change '-n' so that it implies '-l' rather than requires '-l'.

Brings ls(1) closer to POSIX.1 2004.
Per discussion with Thomas Klausner and Igor Sobrado.
This commit is contained in:
lukem 2008-09-25 23:44:05 +00:00
parent 221899b84e
commit 41f5d0fda6
2 changed files with 12 additions and 9 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: ls.1,v 1.62 2006/09/22 23:00:32 elad Exp $
.\" $NetBSD: ls.1,v 1.63 2008/09/25 23:44:05 lukem 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 September 23, 2006
.Dd September 25, 2008
.Dt LS 1
.Os
.Sh NAME
@ -159,10 +159,11 @@ listing.
.It Fl m
Stream output format; list files across the page, separated by commas.
.It Fl n
Display the user and group IDs numerically rather than converting
to a user or group name in a long
.Pq Fl l
output.
The same as
.Fl l ,
except that
the owner and group IDs are displayed numerically rather than converting
to a owner or group name.
.It Fl o
Include the file flags in a long
.Pq Fl l
@ -320,7 +321,7 @@ number of 512-byte blocks used by the files in the directory is displayed
on a line by itself immediately before the information for the files in the
directory.
.Pp
If the owner or group names are not a known user or group name,
If the owner or group names are not a known owner or group name,
or the
.Fl n
option is given,

View File

@ -1,4 +1,4 @@
/* $NetBSD: ls.c,v 1.64 2008/07/20 00:52:40 lukem Exp $ */
/* $NetBSD: ls.c,v 1.65 2008/09/25 23:44:05 lukem Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\
#if 0
static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94";
#else
__RCSID("$NetBSD: ls.c,v 1.64 2008/07/20 00:52:40 lukem Exp $");
__RCSID("$NetBSD: ls.c,v 1.65 2008/09/25 23:44:05 lukem Exp $");
#endif
#endif /* not lint */
@ -232,6 +232,8 @@ ls_main(int argc, char *argv[])
break;
case 'n':
f_numericonly = 1;
f_longform = 1;
f_column = f_columnacross = f_singlecol = f_stream = 0;
break;
case 'o':
f_flags = 1;