Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ls Add -X (don't cross mount points when recursing) from...



details:   https://anonhg.NetBSD.org/src/rev/0e81e1e27b7c
branches:  trunk
changeset: 793615:0e81e1e27b7c
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 21 02:42:41 2014 +0000

description:
Add -X (don't cross mount points when recursing) from tls@

diffstat:

 bin/ls/ls.1 |   6 ++++--
 bin/ls/ls.c |  12 ++++++++----
 2 files changed, 12 insertions(+), 6 deletions(-)

diffs (74 lines):

diff -r 229165638380 -r 0e81e1e27b7c bin/ls/ls.1
--- a/bin/ls/ls.1       Fri Feb 21 02:10:40 2014 +0000
+++ b/bin/ls/ls.1       Fri Feb 21 02:42:41 2014 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ls.1,v 1.74 2014/02/20 19:10:25 wiz Exp $
+.\"    $NetBSD: ls.1,v 1.75 2014/02/21 02:42:41 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -40,7 +40,7 @@
 .Nd list directory contents
 .Sh SYNOPSIS
 .Nm
-.Op Fl 1AaBbCcdFfghikLlMmnOoPpqRrSsTtuWwx
+.Op Fl 1AaBbCcdFfghikLlMmnOoPpqRrSsTtuWwXx
 .Op Ar
 .Sh DESCRIPTION
 For each
@@ -254,6 +254,8 @@
 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 X
+Don't cross mount points when recursing.
 .El
 .Pp
 The
diff -r 229165638380 -r 0e81e1e27b7c bin/ls/ls.c
--- a/bin/ls/ls.c       Fri Feb 21 02:10:40 2014 +0000
+++ b/bin/ls/ls.c       Fri Feb 21 02:42:41 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ls.c,v 1.71 2014/02/20 18:56:36 christos Exp $ */
+/*     $NetBSD: ls.c,v 1.72 2014/02/21 02:42:41 christos Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)ls.c       8.7 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: ls.c,v 1.71 2014/02/20 18:56:36 christos Exp $");
+__RCSID("$NetBSD: ls.c,v 1.72 2014/02/21 02:42:41 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -119,7 +119,7 @@
 {
 
        (void)fprintf(stderr,
-           "usage: %s [-1AaBbCcdFfghikLlMmnopqRrSsTtuWwx] [file ...]\n",
+           "usage: %s [-1AaBbCcdFfghikLlMmnOoPpqRrSsTtuWwXx] [file ...]\n",
            getprogname());
        exit(EXIT_FAILURE);
        /* NOTREACHED */
@@ -151,7 +151,8 @@
                f_listdot = 1;
 
        fts_options = FTS_PHYSICAL;
-       while ((ch = getopt(argc, argv, "1ABCFLMOPRSTWabcdfghiklmnopqrstuwx")) != -1) {
+       while ((ch = getopt(argc, argv, "1AaBbCcdFfghikLlMmnOoPpqRrSsTtWwXx"))
+           != -1) {
                switch (ch) {
                /*
                 * The -1, -C, -l, -m and -x options all override each other so
@@ -297,6 +298,9 @@
                        f_octal = 0;
                        f_octal_escape = 0;
                        break;
+               case 'X':
+                       fts_options |= FTS_XDEV;
+                       break;
                default:
                case '?':
                        usage();



Home | Main Index | Thread Index | Old Index