Print this page
667 cp support for -a flag
@@ -180,20 +180,20 @@
exit(1);
}
/*
* Check for options:
- * cp -r|-R [-H|-L|-P] [-fip@/] file1 [file2 ...] target
- * cp [-fiprR@/] file1 [file2 ...] target
+ * cp [ -r|-R [-H|-L|-P]] [-afip@/] file1 [file2 ...] target
+ * cp [-afiprR@/] file1 [file2 ...] target
* ln [-f] [-n] [-s] file1 [file2 ...] target
* ln [-f] [-n] [-s] file1 [file2 ...]
* mv [-f|i] file1 [file2 ...] target
* mv [-f|i] dir1 target
*/
if (cpy) {
- while ((c = getopt(argc, argv, "fHiLpPrR@/")) != EOF)
+ while ((c = getopt(argc, argv, "afHiLpPrR@/")) != EOF)
switch (c) {
case 'f':
fflg++;
break;
case 'i':
@@ -236,10 +236,17 @@
Rflg++;
/*FALLTHROUGH*/
case 'r':
rflg++;
break;
+ case 'a':
+ Lflg = Hflg = 0;
+ pflg++;
+ Pflg++;
+ Rflg++;
+ rflg++;
+ break;
case '@':
atflg++;
attrsilent = 0;
#ifdef XPG4
pflg = 0;
@@ -1321,14 +1328,14 @@
" ln [-f] [-n] [-s] f1 ... fn d1\n"
" ln [-f] [-n] -s d1 d2\n"));
#endif
} else if (cpy) {
(void) fprintf(stderr, gettext(
- "Usage: cp [-f] [-i] [-p] [-@] [-/] f1 f2\n"
- " cp [-f] [-i] [-p] [-@] [-/] f1 ... fn d1\n"
- " cp -r|-R [-H|-L|-P] [-f] [-i] [-p] [-@] [-/] "
- "d1 ... dn-1 dn\n"));
+ "Usage: cp [-a] [-f] [-i] [-p] [-@] [-/] f1 f2\n"
+ " cp [-a] [-f] [-i] [-p] [-@] [-/] f1 ... fn d1\n"
+ " cp [-r|-R [-H|-L|-P]] [-a] [-f] [-i] [-p] [-@] "
+ "[-/] d1 ... dn-1 dn\n"));
}
exit(2);
}
/*