Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/cp Add -a archive flag. from Aleksey Cheusov
details: https://anonhg.NetBSD.org/src/rev/1e9787a64907
branches: trunk
changeset: 759954:1e9787a64907
user: christos <christos%NetBSD.org@localhost>
date: Tue Dec 21 20:56:01 2010 +0000
description:
Add -a archive flag. from Aleksey Cheusov
diffstat:
bin/cp/cp.1 | 10 +++++++---
bin/cp/cp.c | 12 +++++++++---
bin/cp/utils.c | 8 ++++----
3 files changed, 20 insertions(+), 10 deletions(-)
diffs (107 lines):
diff -r 59fba2cff981 -r 1e9787a64907 bin/cp/cp.1
--- a/bin/cp/cp.1 Tue Dec 21 20:39:53 2010 +0000
+++ b/bin/cp/cp.1 Tue Dec 21 20:56:01 2010 +0000
@@ -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 ,
diff -r 59fba2cff981 -r 1e9787a64907 bin/cp/cp.c
--- a/bin/cp/cp.c Tue Dec 21 20:39:53 2010 +0000
+++ b/bin/cp/cp.c Tue Dec 21 20:56:01 2010 +0000
@@ -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;
diff -r 59fba2cff981 -r 1e9787a64907 bin/cp/utils.c
--- a/bin/cp/utils.c Tue Dec 21 20:39:53 2010 +0000
+++ b/bin/cp/utils.c Tue Dec 21 20:56:01 2010 +0000
@@ -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 */
Home |
Main Index |
Thread Index |
Old Index