From owner-freebsd-bugs@FreeBSD.ORG Sun Mar 13 00:40:02 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 729A216A4CE for ; Sun, 13 Mar 2005 00:40:02 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A2C843D5E for ; Sun, 13 Mar 2005 00:40:01 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2D0e1rF080856 for ; Sun, 13 Mar 2005 00:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2D0e1WE080855; Sun, 13 Mar 2005 00:40:01 GMT (envelope-from gnats) Resent-Date: Sun, 13 Mar 2005 00:40:01 GMT Resent-Message-Id: <200503130040.j2D0e1WE080855@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Erik Greenwald Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4324016A4CE for ; Sun, 13 Mar 2005 00:33:01 +0000 (GMT) Received: from phoenix.smluc.org (phoenix.smluc.org [12.28.48.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE66C43D2D for ; Sun, 13 Mar 2005 00:33:00 +0000 (GMT) (envelope-from erik@smluc.org) Received: by phoenix.smluc.org (Postfix, from userid 1000) id 2E1AB1CE55; Sat, 12 Mar 2005 18:33:42 -0600 (CST) Message-Id: <20050313003342.2E1AB1CE55@phoenix.smluc.org> Date: Sat, 12 Mar 2005 18:33:42 -0600 (CST) From: Erik Greenwald To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: erik@math.smsu.edu Subject: bin/78759: patch: verbosity for bin/chflags X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Erik Greenwald List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2005 00:40:02 -0000 >Number: 78759 >Category: bin >Synopsis: patch: verbosity for bin/chflags >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 13 00:40:01 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Erik Greenwald >Release: FreeBSD 5.3-RELEASE-p2 i386 >Organization: >Environment: FreeBSD vidar.br0kenland.org 6.0-CURRENT FreeBSD 6.0-CURRENT #9: Sun Mar 6 12:38:06 EST 2005 root@vidar.br0kenland.org:/usr/obj/usr/src/sys/VIDAR i386 >Description: this patch adds a -v option to bin/chflags. 2+ -v's will also print the "flags" variable (the names, like, say, "schg nodump" after the file name... it may be better to map out the actual changes and print those? *shrug* Man page and programs help have been updated to reflect. >How-To-Repeat: >Fix: --- bin_chflags.patch begins here --- Index: bin/chflags/chflags.1 =================================================================== RCS file: /home/ncvs/src/bin/chflags/chflags.1,v retrieving revision 1.23 diff -u -r1.23 chflags.1 --- bin/chflags/chflags.1 25 Feb 2005 00:40:46 -0000 1.23 +++ bin/chflags/chflags.1 13 Mar 2005 00:28:55 -0000 @@ -40,6 +40,7 @@ .Nd change file flags .Sh SYNOPSIS .Nm +.Op Fl v .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -73,6 +74,11 @@ .It Fl R Change the file flags for the file hierarchies rooted in the files instead of just the files themselves. +.It Fl v +Cause +.Nm +to be move verbose, printing the name of the files as their flags are modified. +If specified more than once, the flags applied are printed as well. .El .Pp The flags are specified as an octal number or a comma separated list Index: bin/chflags/chflags.c =================================================================== RCS file: /home/ncvs/src/bin/chflags/chflags.c,v retrieving revision 1.22 diff -u -r1.22 chflags.c --- bin/chflags/chflags.c 10 Jan 2005 08:39:20 -0000 1.22 +++ bin/chflags/chflags.c 13 Mar 2005 00:28:55 -0000 @@ -62,11 +62,11 @@ FTSENT *p; u_long clear, set; long val; - int Hflag, Lflag, Rflag, ch, fts_options, oct, rval; + int Hflag, Lflag, Rflag, ch, fts_options, oct, rval, vflag; char *flags, *ep; - Hflag = Lflag = Rflag = 0; - while ((ch = getopt(argc, argv, "HLPR")) != -1) + Hflag = Lflag = Rflag = vflag = 0; + while ((ch = getopt(argc, argv, "HLPRv")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -82,6 +82,9 @@ case 'R': Rflag = 1; break; + case 'v': + vflag++; + break; case '?': default: usage(); @@ -151,6 +154,17 @@ default: break; } + + if (vflag) { + (void)printf("%s", p->fts_path); + /* + * Perhaps this should print the previous flags as well? + */ + if (vflag > 1) + (void)printf(": %s", flags); + (void)printf("\n"); + } + if (oct) { if (!chflags(p->fts_accpath, set)) continue; @@ -172,6 +186,6 @@ usage(void) { (void)fprintf(stderr, - "usage: chflags [-R [-H | -L | -P]] flags file ...\n"); + "usage: chflags [-v] [-R [-H | -L | -P]] flags file ...\n"); exit(1); } --- bin_chflags.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: