Add -R as a synonym to -r for cp(1)
List the available options in the usage line as well.
This commit is contained in:
parent
7f6d5653c6
commit
aff51008ea
7
cp.1
7
cp.1
|
@ -3,12 +3,12 @@
|
||||||
cp \- copy files and directories
|
cp \- copy files and directories
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B cp
|
.B cp
|
||||||
.RB [ \-r ]
|
.RB [ \-Rr ]
|
||||||
.I file
|
.I file
|
||||||
.RI [ name ]
|
.RI [ name ]
|
||||||
.P
|
.P
|
||||||
.B cp
|
.B cp
|
||||||
.RB [ \-r ]
|
.RB [ \-Rr ]
|
||||||
.RI [ file ...]
|
.RI [ file ...]
|
||||||
.RI [ directory ]
|
.RI [ directory ]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
@ -17,6 +17,9 @@ copies a given file, naming it the given name. If multiple files are listed
|
||||||
they will be copied into the given directory.
|
they will be copied into the given directory.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
|
.B \-R
|
||||||
|
equivalent to -r.
|
||||||
|
.TP
|
||||||
.B \-r
|
.B \-r
|
||||||
copies directories recursively. If this flag is not specified, directories are
|
copies directories recursively. If this flag is not specified, directories are
|
||||||
not copied.
|
not copied.
|
||||||
|
|
3
cp.c
3
cp.c
|
@ -8,7 +8,7 @@
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
eprintf("usage: %s source... dest\n", argv0);
|
eprintf("usage: %s [-Rr] source... dest\n", argv0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -17,6 +17,7 @@ main(int argc, char *argv[])
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
|
case 'R':
|
||||||
case 'r':
|
case 'r':
|
||||||
cp_rflag = true;
|
cp_rflag = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user