Add -D to install

Andreas Hauser andy at splashground.de
Fri May 26 11:16:45 PDT 2006


joerg wrote @ Fri, 26 May 2006 18:06:13 +0200:
> On Fri, May 26, 2006 at 05:54:59PM +0200, Andreas Hauser wrote:
> > Hoi,
> > 
> > Add the -D flag, an alias to -d, which is used on other systems.
> 
> I object this one, since the -D flag has a different semantics e.g.
> compared to the NetBSD version.

This patch makes -D emit a warning and be ignored and documents that.

-- 
Andy

diff -r 637229d428bc usr.bin/xinstall/install.1
--- a/usr.bin/xinstall/install.1	Sat May 13 05:10:40 2006 +0000
+++ b/usr.bin/xinstall/install.1	Fri May 26 17:57:07 2006 +0200
@@ -41,7 +41,7 @@
 .Nd install binaries
 .Sh SYNOPSIS
 .Nm
-.Op Fl bCclMpSsv
+.Op Fl bCcDlMpSsv
 .Op Fl L Ar etcdir
 .Op Fl B Ar suffix
 .Op Fl f Ar flags
@@ -50,7 +50,7 @@
 .Op Fl o Ar owner
 .Ar file1 file2
 .Nm
-.Op Fl bCclMpSsv
+.Op Fl bCcDlMpSsv
 .Op Fl L Ar etcdir
 .Op Fl B Ar suffix
 .Op Fl f Ar flags
@@ -60,7 +60,7 @@
 .Ar file1 ... fileN directory
 .Nm
 .Fl d
-.Op Fl vl
+.Op Fl Dvl
 .Op Fl L Ar etcdir
 .Op Fl g Ar group
 .Op Fl m Ar mode
@@ -119,6 +119,9 @@ option is only included for backwards co
 .It Fl d
 Create directories.
 Missing parent directories are created as required.
+.It Fl D
+Don't use! Ignored. A warning is printed to STDERR. Different meaning in
+different implementations.
 .It Fl f
 Specify the target's file flags; see
 .Xr chflags 1
diff -r 637229d428bc usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c	Sat May 13 05:10:40 2006 +0000
+++ b/usr.bin/xinstall/xinstall.c	Fri May 26 17:57:07 2006 +0200
@@ -111,7 +111,7 @@ main(int argc, char **argv)
 	owner = NULL;
 	etcdir = NULL;
 
-	while ((ch = getopt(argc, argv, "L:B:bCcdf:g:lMm:o:pSsv")) != -1)
+	while ((ch = getopt(argc, argv, "L:B:bCcdDf:g:lMm:o:pSsv")) != -1)
 		switch((char)ch) {
 		case 'L':
 			etcdir = optarg;
@@ -127,6 +127,9 @@ main(int argc, char **argv)
 			break;
 		case 'c':
 			/* For backwards compatibility. */
+			break;
+		case 'D':
+			warnc(EINVAL, "-D is ambigous and thus will be ignored");
 			break;
 		case 'd':
 			dodir = 1;





More information about the Submit mailing list