Module Name:    src
Committed By:   christos
Date:           Tue Dec 21 20:56:01 UTC 2010

Modified Files:
        src/bin/cp: cp.1 cp.c utils.c

Log Message:
Add -a archive flag. from Aleksey Cheusov


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/bin/cp/cp.1
cvs rdiff -u -r1.53 -r1.54 src/bin/cp/cp.c
cvs rdiff -u -r1.36 -r1.37 src/bin/cp/utils.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/cp/cp.1
diff -u src/bin/cp/cp.1:1.30 src/bin/cp/cp.1:1.31
--- src/bin/cp/cp.1:1.30	Fri Oct 26 12:31:16 2007
+++ src/bin/cp/cp.1	Tue Dec 21 15:56:01 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: cp.1,v 1.30 2007/10/26 16:31:16 hira Exp $
+.\"	$NetBSD: cp.1,v 1.31 2010/12/21 20:56:01 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -45,7 +45,7 @@
 .Op Fl H | Fl L | Fl P
 .Oc
 .Op Fl f | i
-.Op Fl Npv
+.Op Fl aNpv
 .Ar source_file target_file
 .Nm cp
 .Oo
@@ -53,7 +53,7 @@
 .Op Fl H | Fl L | Fl P
 .Oc
 .Op Fl f | i
-.Op Fl Npv
+.Op Fl aNpv
 .Ar source_file ... target_directory
 .Sh DESCRIPTION
 In the first synopsis form, the
@@ -100,6 +100,10 @@
 If the
 .Fl R
 option is specified, all symbolic links are followed.
+.It Fl a
+Archive mode.
+Same as
+.Fl RpP .
 .It Fl N
 When used with
 .Fl p ,

Index: src/bin/cp/cp.c
diff -u src/bin/cp/cp.c:1.53 src/bin/cp/cp.c:1.54
--- src/bin/cp/cp.c:1.53	Thu Oct  8 16:36:41 2009
+++ src/bin/cp/cp.c	Tue Dec 21 15:56:01 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: cp.c,v 1.53 2009/10/08 20:36:41 pooka Exp $ */
+/* $NetBSD: cp.c,v 1.54 2010/12/21 20:56:01 christos Exp $ */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)cp.c	8.5 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: cp.c,v 1.53 2009/10/08 20:36:41 pooka Exp $");
+__RCSID("$NetBSD: cp.c,v 1.54 2010/12/21 20:56:01 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -106,7 +106,7 @@
 	(void)setlocale(LC_ALL, "");
 
 	Hflag = Lflag = Pflag = Rflag = 0;
-	while ((ch = getopt(argc, argv, "HLNPRfiprv")) != -1) 
+	while ((ch = getopt(argc, argv, "HLNPRfaiprv")) != -1) 
 		switch (ch) {
 		case 'H':
 			Hflag = 1;
@@ -126,6 +126,12 @@
 		case 'R':
 			Rflag = 1;
 			break;
+		case 'a':
+			Pflag = 1;
+			pflag = 1;
+			Rflag = 1;
+			Hflag = Lflag = 0;
+			break;
 		case 'f':
 			fflag = 1;
 			iflag = 0;

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.36 src/bin/cp/utils.c:1.37
--- src/bin/cp/utils.c:1.36	Mon Oct 25 04:19:47 2010
+++ src/bin/cp/utils.c	Tue Dec 21 15:56:01 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.36 2010/10/25 08:19:47 tron Exp $ */
+/* $NetBSD: utils.c,v 1.37 2010/12/21 20:56:01 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utils.c	8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: utils.c,v 1.36 2010/10/25 08:19:47 tron Exp $");
+__RCSID("$NetBSD: utils.c,v 1.37 2010/12/21 20:56:01 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -367,8 +367,8 @@
 usage(void)
 {
 	(void)fprintf(stderr,
-	    "usage: %s [-R [-H | -L | -P]] [-f | -i] [-Npv] src target\n"
-	    "       %s [-R [-H | -L | -P]] [-f | -i] [-Npv] src1 ... srcN directory\n",
+	    "usage: %s [-R [-H | -L | -P]] [-f | -i] [-aNpv] src target\n"
+	    "       %s [-R [-H | -L | -P]] [-f | -i] [-aNpv] src1 ... srcN directory\n",
 	    getprogname(), getprogname());
 	exit(1);
 	/* NOTREACHED */

Reply via email to