Page MenuHomeFreeBSD

D33586.diff
No OneTemporary

D33586.diff

diff --git a/usr.sbin/usbconfig/usbconfig.8 b/usr.sbin/usbconfig/usbconfig.8
--- a/usr.sbin/usbconfig/usbconfig.8
+++ b/usr.sbin/usbconfig/usbconfig.8
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 20, 2021
+.Dd December 21, 2021
.Dt USBCONFIG 8
.Os
.Sh NAME
@@ -34,10 +34,12 @@
.Op Fl u Ar unit
.Op Fl a Ar addr
.Op Fl i Ar interface_index
+.Op Fl v
.Op cmds...
.Nm
.Fl d Ar [[/dev/]ugen]<unit>.<addr>
.Op Fl i Ar interface_index
+.Op Fl v
.Op cmds...
.Sh DESCRIPTION
The
@@ -56,11 +58,19 @@
The unit and address coordinates may be prefixed by the lowercased word "ugen",
or the full path name
.Pa /dev/ugen .
+.It Fl h
+Show help and available commands.
.It Fl i Ar interface_index
Specify interface index as indicated by the command description.
If this argument is not specified a value of zero will be used for the interface index.
-.It Fl h
-Show help and available commands.
+.It Fl v
+Shortcut to activate the
+.Cm dump_device_desc ,
+.Cm dump_curr_config_desc ,
+and
+.Cm show_ifdrv
+commands
+.Pq Dq verbose mode .
.El
.Pp
The following commands may be used with
diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c
--- a/usr.sbin/usbconfig/usbconfig.c
+++ b/usr.sbin/usbconfig/usbconfig.c
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <err.h>
+#include <sysexits.h>
#include <string.h>
#include <unistd.h>
#include <pwd.h>
@@ -267,12 +268,12 @@
}
static void
-usage(void)
+usage(int exitcode)
{
fprintf(stderr, ""
"usbconfig - configure the USB subsystem" "\n"
- "usage: usbconfig [-u <busnum>] [-a <devaddr>] [-i <ifaceindex>] [cmds...]" "\n"
- "usage: usbconfig -d [ugen]<busnum>.<devaddr> [-i <ifaceindex>] [cmds...]" "\n"
+ "usage: usbconfig [-u <busnum>] [-a <devaddr>] [-i <ifaceindex>] [-v] [cmds...]" "\n"
+ "usage: usbconfig -d [ugen]<busnum>.<devaddr> [-i <ifaceindex>] [-v] [cmds...]" "\n"
"commands:" "\n"
" set_config <cfg_index>" "\n"
" set_alt <alt_index>" "\n"
@@ -558,13 +559,13 @@
int ch;
if (argc < 1) {
- usage();
+ usage(EX_USAGE);
}
pbe = libusb20_be_alloc_default();
if (pbe == NULL)
err(1, "could not access USB backend\n");
- while ((ch = getopt(argc, argv, "a:d:i:u:")) != -1) {
+ while ((ch = getopt(argc, argv, "a:d:hi:u:v")) != -1) {
switch (ch) {
case 'a':
opt->addr = num_id(optarg, "addr");
@@ -593,6 +594,10 @@
opt->got_addr = 1;
break;
+ case 'h':
+ usage(EX_OK);
+ break;
+
case 'i':
opt->iface = num_id(optarg, "iface");
break;
@@ -602,8 +607,15 @@
opt->got_bus = 1;
break;
+ case 'v':
+ opt->got_dump_device_desc = 1;
+ opt->got_dump_curr_config = 1;
+ opt->got_show_iface_driver = 1;
+ opt->got_any += 2; /* only the dump options count */
+ break;
+
default:
- usage();
+ usage(EX_USAGE);
}
}
argc -= optind;
@@ -856,7 +868,7 @@
&unit, &addr) != 2) ||
(unit < 0) || (unit > 65535) ||
(addr < 0) || (addr > 65535)) {
- usage();
+ usage(EX_USAGE);
break;
}
@@ -866,7 +878,7 @@
opt->got_addr = 1;
break;
}
- usage();
+ usage(EX_USAGE);
break;
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 21, 5:30 AM (22 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14755413
Default Alt Text
D33586.diff (3 KB)

Event Timeline