$OpenBSD: patch-lsusb_c,v 1.2 2012/07/16 20:17:03 mpi Exp $

Disable unsupported options.

--- lsusb.c.orig	Sun Oct 30 20:35:50 2011
+++ lsusb.c	Mon Jul 16 18:05:14 2012
@@ -3902,6 +3902,7 @@ void devtree_devdisconnect(struct usbdevnode *dev)
 	dev = dev;	/* reduce compiler warnings */
 }
 
+#ifndef __OpenBSD__
 static int treedump(void)
 {
 	int fd;
@@ -3919,6 +3920,7 @@ static int treedump(void)
 	devtree_dump(verblevel);
 	return 0;
 }
+#endif
 
 /* ---------------------------------------------------------------------- */
 
@@ -3937,7 +3939,7 @@ int main(int argc, char *argv[])
 	char *cp;
 	int status;
 
-	while ((c = getopt_long(argc, argv, "D:vxtP:p:s:d:V",
+	while ((c = getopt_long(argc, argv, "D:vxP:p:s:d:V",
 			long_options, NULL)) != EOF) {
 		switch (c) {
 		case 'V':
@@ -3951,11 +3953,11 @@ int main(int argc, char *argv[])
 		case 'x':
 			allowctrlmsg = 1;
 			break;
-
+#ifndef __OpenBSD__
 		case 't':
 			treemode = 1;
 			break;
-
+#endif
 		case 's':
 			cp = strchr(optarg, ':');
 			if (cp) {
@@ -3983,9 +3985,11 @@ int main(int argc, char *argv[])
 				product = strtoul(cp, NULL, 16);
 			break;
 
+#ifndef __OpenBSD__
 		case 'D':
 			devdump = optarg;
 			break;
+#endif
 
 		case '?':
 		default:
@@ -4004,10 +4008,12 @@ int main(int argc, char *argv[])
 			"  -d vendor:[product]\n"
 			"      Show only devices with the specified vendor and\n"
 			"      product ID numbers (in hexadecimal)\n"
+#ifndef __OpenBSD__
 			"  -D device\n"
 			"      Selects which device lsusb will examine\n"
 			"  -t\n"
 			"      Dump the physical USB device hierarchy as a tree\n"
+#endif
 			"  -V, --version\n"
 			"      Show version of program\n"
 			);
@@ -4033,13 +4039,16 @@ int main(int argc, char *argv[])
 		return EXIT_FAILURE;
 	}
 
+#ifndef __OpenBSD__
 	if (treemode) {
 		/* treemode requires at least verblevel 1 */
 		verblevel += 1 - VERBLEVEL_DEFAULT;
 		status = treedump();
-	} else if (devdump)
+	} else
+	if (devdump)
 		status = dump_one_device(ctx, devdump);
 	else
+#endif
 		status = list_devices(ctx, bus, devnum, vendor, product);
 
 	names_exit();
