cp: add -a, -d, -p

This commit is contained in:
Hiltjo Posthuma
2014-07-09 21:28:43 +00:00
committed by sin
parent 8e8d8ff242
commit 8b3a9c1971
4 changed files with 97 additions and 30 deletions

14
cp.c
View File

@@ -8,7 +8,7 @@
static void
usage(void)
{
eprintf("usage: %s [-fRr] source... dest\n", argv0);
eprintf("usage: %s [-adfpRr] source... dest\n", argv0);
}
int
@@ -17,6 +17,18 @@ main(int argc, char *argv[])
struct stat st;
ARGBEGIN {
case 'a':
cp_aflag = true; /* implies -dpr */
cp_dflag = true;
cp_pflag = true;
cp_rflag = true;
break;
case 'd':
cp_dflag = true;
break;
case 'p':
cp_pflag = true;
break;
case 'f':
cp_fflag = true;
break;