Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/chown Added -v extension. Approved by Klaus (kleink).



details:   https://anonhg.NetBSD.org/src/rev/8c927b1f9d8c
branches:  trunk
changeset: 541802:8c927b1f9d8c
user:      jrf <jrf%NetBSD.org@localhost>
date:      Sat Jan 18 18:37:07 2003 +0000

description:
Added -v extension. Approved by Klaus (kleink).

diffstat:

 usr.sbin/chown/chgrp.1 |  17 +++++++++++++----
 usr.sbin/chown/chown.8 |  19 ++++++++++++++-----
 usr.sbin/chown/chown.c |  22 ++++++++++++++--------
 3 files changed, 41 insertions(+), 17 deletions(-)

diffs (189 lines):

diff -r afae9335052f -r 8c927b1f9d8c usr.sbin/chown/chgrp.1
--- a/usr.sbin/chown/chgrp.1    Sat Jan 18 18:32:20 2003 +0000
+++ b/usr.sbin/chown/chgrp.1    Sat Jan 18 18:37:07 2003 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1983, 1990, 1993, 1994
+.\" Copyright (c) 1983, 1990, 1993, 1994, 2003
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
@@ -33,9 +33,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     from: @(#)chgrp.1      8.3 (Berkeley) 3/31/94
-.\"    $NetBSD: chgrp.1,v 1.13 2002/02/08 01:38:47 ross Exp $
+.\"    $NetBSD: chgrp.1,v 1.14 2003/01/18 18:37:07 jrf Exp $
 .\"
-.Dd March 31, 1994
+.Dd January 18, 2003
 .Dt CHGRP 1
 .Os
 .Sh NAME
@@ -47,7 +47,7 @@
 .Fl R
 .Op Fl H | Fl L | Fl P
 .Oc
-.Op Fl fh
+.Op Fl fhv
 .Ar group
 .Ar files ...
 .Sh DESCRIPTION
@@ -84,6 +84,10 @@
 If
 .Ar file
 is a symbolic link, the group of the link is changed.
+.It Fl v
+Cause
+.Nm
+to be verbose, showing files as they are processed.
 .El
 .Pp
 If
@@ -144,3 +148,8 @@
 The
 .Nm
 utility is expected to be POSIX 1003.2 compatible.
+.Pp
+The
+.Fl v
+option is an extension to 
+.St -p1003.2 .
diff -r afae9335052f -r 8c927b1f9d8c usr.sbin/chown/chown.8
--- a/usr.sbin/chown/chown.8    Sat Jan 18 18:32:20 2003 +0000
+++ b/usr.sbin/chown/chown.8    Sat Jan 18 18:37:07 2003 +0000
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1990, 1991, 1993, 1994
+.\" Copyright (c) 1990, 1991, 1993, 1994, 2003
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -30,9 +30,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     from: @(#)chown.8      8.3 (Berkeley) 3/31/94
-.\"    $NetBSD: chown.8,v 1.14 2002/02/08 01:38:47 ross Exp $
+.\"    $NetBSD: chown.8,v 1.15 2003/01/18 18:37:08 jrf Exp $
 .\"
-.Dd March 31, 1994
+.Dd January 18, 2003
 .Dt CHOWN 8
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@
 .Fl R
 .Op Fl H | Fl L | Fl P
 .Oc
-.Op Fl fh
+.Op Fl fhv
 .Ar owner Ns Op Ar :group
 .Ar file ...
 .Nm ""
@@ -52,7 +52,7 @@
 .Fl R
 .Op Fl H | Fl L | Fl P
 .Oc
-.Op Fl fh
+.Op Fl fhv
 .Ar :group
 .Ar file ...
 .Sh DESCRIPTION
@@ -84,6 +84,10 @@
 If
 .Ar file
 is a symbolic link, the owner and/or group of the link is changed.
+.It Fl v
+Cause
+.Nm 
+to be verbose, showing files as they are processed.
 .El
 .Pp
 The
@@ -152,3 +156,8 @@
 The
 .Nm
 command is expected to be POSIX 1003.2 compliant.
+.Pp
+The
+.Fl v
+option is an extension to
+.St -p1003.2 .
diff -r afae9335052f -r 8c927b1f9d8c usr.sbin/chown/chown.c
--- a/usr.sbin/chown/chown.c    Sat Jan 18 18:32:20 2003 +0000
+++ b/usr.sbin/chown/chown.c    Sat Jan 18 18:37:07 2003 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: chown.c,v 1.26 2002/07/07 11:44:03 bjh21 Exp $ */
+/*     $NetBSD: chown.c,v 1.27 2003/01/18 18:37:08 jrf Exp $   */
 
 /*
- * Copyright (c) 1988, 1993, 1994
+ * Copyright (c) 1988, 1993, 1994, 2003
  *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\
+__COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994, 2003\n\
        The Regents of the University of California.  All rights reserved.\n");
 #endif /* not lint */
 
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)chown.c    8.8 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: chown.c,v 1.26 2002/07/07 11:44:03 bjh21 Exp $");
+__RCSID("$NetBSD: chown.c,v 1.27 2003/01/18 18:37:08 jrf Exp $");
 #endif
 #endif /* not lint */
 
@@ -81,7 +81,7 @@
 {
        FTS *ftsp;
        FTSENT *p;
-       int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval;
+       int Hflag, Lflag, Rflag, ch, fflag, fts_options, hflag, rval, vflag;
        char *cp;
        int (*change_owner) __P((const char *, uid_t, gid_t));
 
@@ -90,8 +90,8 @@
        myname = (cp = strrchr(*argv, '/')) ? cp + 1 : *argv;
        ischown = (myname[2] == 'o');
 
-       Hflag = Lflag = Rflag = fflag = hflag = 0;
-       while ((ch = getopt(argc, argv, "HLPRfh")) != -1)
+       Hflag = Lflag = Rflag = fflag = hflag = vflag = 0;
+       while ((ch = getopt(argc, argv, "HLPRfhv")) != -1)
                switch (ch) {
                case 'H':
                        Hflag = 1;
@@ -120,6 +120,9 @@
                         */
                        hflag = 1;
                        break;
+               case 'v':
+                       vflag = 1;
+                       break;
                case '?':
                default:
                        usage();
@@ -213,6 +216,9 @@
                if ((*change_owner)(p->fts_accpath, uid, gid) && !fflag) {
                        warn("%s", p->fts_path);
                        rval = EXIT_FAILURE;
+               } else {
+                       if (vflag)
+                               printf("%s\n", p->fts_path);
                }
        }
        if (errno)
@@ -270,7 +276,7 @@
 {
 
        (void)fprintf(stderr,
-           "usage: %s [-R [-H | -L | -P]] [-fh] %s file ...\n",
+           "usage: %s [-R [-H | -L | -P]] [-fhv] %s file ...\n",
            myname, ischown ? "[owner][:group]" : "group");
        exit(EXIT_FAILURE);
 }



Home | Main Index | Thread Index | Old Index