From 41f5d0fda632a1a1907721419a46ecc5b23e3eb2 Mon Sep 17 00:00:00 2001 From: lukem Date: Thu, 25 Sep 2008 23:44:05 +0000 Subject: [PATCH] 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. --- bin/ls/ls.1 | 15 ++++++++------- bin/ls/ls.c | 6 ++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 3b587c2395a5..e2bf4b02183c 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -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, diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 7d2bc6de8335..79aae9959cb7 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -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;