Subject: cp.diff man page change
To: None <tech-userlevel@netbsd.org>
From: Jason R. Fink <jrf@adresearch.com>
List: tech-userlevel
Date: 12/14/2002 18:34:15
--EVF5PPMfhYS0aIcm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello all,

How does the man page diff look?

	j

-- 
Jay Fink http://pyxis.homeunix.net/
NetBSD Developer http://www.netbsd.org/
Senior SysAdmin/Programmer, Ipsos http://www.ipsos.com/

--EVF5PPMfhYS0aIcm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="cp.diff"

? cp.diff
Index: cp.1
===================================================================
RCS file: /cvsroot/basesrc/bin/cp/cp.1,v
retrieving revision 1.19
diff -u -r1.19 cp.1
--- cp.1	2002/02/08 01:21:55	1.19
+++ cp.1	2002/12/14 23:32:54
@@ -139,6 +139,10 @@
 and either the user ID or group ID cannot be preserved, neither
 the set user ID or set group ID bits are preserved in the copy's
 permissions.
+.It Fl v  
+Cause
+.Nm 
+to be verbose, showing files as they are copied.
 .El
 .Pp
 For each destination file that already exists, its contents are
@@ -213,3 +217,7 @@
 utility is expected to be
 .St -p1003.2
 compatible.
+.Pp
+The flag
+.Op Fl v
+is an extension to the specification.
Index: cp.c
===================================================================
RCS file: /cvsroot/basesrc/bin/cp/cp.c,v
retrieving revision 1.31
diff -u -r1.31 cp.c
--- cp.c	2001/09/13 09:53:59	1.31
+++ cp.c	2002/12/14 23:32:54
@@ -88,7 +88,7 @@
 PATH_T to = { to.p_path, "" };
 
 uid_t myuid;
-int Rflag, fflag, iflag, pflag, rflag; 
+int Rflag, fflag, iflag, pflag, rflag, vflag; 
 mode_t myumask;
 
 enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
@@ -108,7 +108,7 @@
 	(void)setlocale(LC_ALL, "");
 
 	Hflag = Lflag = Pflag = Rflag = 0;
-	while ((ch = getopt(argc, argv, "HLPRfipr")) != -1) 
+	while ((ch = getopt(argc, argv, "HLPRfiprv")) != -1) 
 		switch (ch) {
 		case 'H':
 			Hflag = 1;
@@ -139,6 +139,9 @@
 		case 'r':
 			rflag = 1;
 			break;
+		case 'v':
+			vflag = 1;
+			break;
 		case '?':
 		default:
 			usage();
@@ -452,6 +455,8 @@
 				rval = 1;
 			break;
 		}
+		if (vflag)
+			(void)printf("%s -> %s\n", curr->fts_path, to.p_path);
 	}
 	if (errno)
 		err(1, "fts_read");
Index: utils.c
===================================================================
RCS file: /cvsroot/basesrc/bin/cp/utils.c,v
retrieving revision 1.21
diff -u -r1.21 utils.c
--- utils.c	2002/10/19 20:33:17	1.21
+++ utils.c	2002/12/14 23:32:54
@@ -330,8 +330,8 @@
 usage(void)
 {
 	(void)fprintf(stderr,
-	    "usage: %s [-R [-H | -L | -P]] [-f | -i] [-p] src target\n"
-	    "       %s [-R [-H | -L | -P]] [-f | -i] [-p] src1 ... srcN directory\n",
+	    "usage: %s [-R [-H | -L | -P]] [-f | -i] [-pv] src target\n"
+	    "       %s [-R [-H | -L | -P]] [-f | -i] [-pv] src1 ... srcN directory\n",
 	    getprogname(), getprogname());
 	exit(1);
 	/* NOTREACHED */

--EVF5PPMfhYS0aIcm--