[hackers] [sbase] Add -R as a synonym to -r for cp(1) || sin

From: <git_AT_suckless.org>
Date: Thu, 12 Dec 2013 14:30:23 +0100

commit aff51008eaa21169c91cdd99c4c22c21fd8a85e9
Author: sin <sin_AT_2f30.org>
Date: Thu Dec 12 13:27:49 2013 +0000

    Add -R as a synonym to -r for cp(1)
    
    List the available options in the usage line as well.

diff --git a/cp.1 b/cp.1
index d2b68a5..0f092c4 100644
--- a/cp.1
+++ b/cp.1
_AT_@ -3,12 +3,12 @@
 cp \- copy files and directories
 .SH SYNOPSIS
 .B cp
-.RB [ \-r ]
+.RB [ \-Rr ]
 .I file
 .RI [ name ]
 .P
 .B cp
-.RB [ \-r ]
+.RB [ \-Rr ]
 .RI [ file ...]
 .RI [ directory ]
 .SH DESCRIPTION
_AT_@ -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.
 .SH OPTIONS
 .TP
+.B \-R
+equivalent to -r.
+.TP
 .B \-r
 copies directories recursively. If this flag is not specified, directories are
 not copied.
diff --git a/cp.c b/cp.c
index 50a57d9..6d864ec 100644
--- a/cp.c
+++ b/cp.c
_AT_@ -8,7 +8,7 @@
 static void
 usage(void)
 {
- eprintf("usage: %s source... dest
", argv0);
+ eprintf("usage: %s [-Rr] source... dest
", argv0);
 }
 
 int
_AT_@ -17,6 +17,7 @@ main(int argc, char *argv[])
         struct stat st;
 
         ARGBEGIN {
+ case 'R':
         case 'r':
                 cp_rflag = true;
                 break;
Received on Thu Dec 12 2013 - 14:30:23 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 12 2013 - 14:36:22 CET