summaryrefslogtreecommitdiff
path: root/usr.sbin/usbdevs
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>1998-07-23 13:57:51 +0000
committeraugustss <augustss@NetBSD.org>1998-07-23 13:57:51 +0000
commitcf835b8a8d459ae26e77512fcd271ea7014e1855 (patch)
treed22a6506f7976781578842c7e0179035ed264773 /usr.sbin/usbdevs
parent02c8f266db23d640bb481de1ac21abc2037158bf (diff)
Update man page.
Be a little more verbose with -v when no controllers were found.
Diffstat (limited to 'usr.sbin/usbdevs')
-rw-r--r--usr.sbin/usbdevs/usbdevs.85
-rw-r--r--usr.sbin/usbdevs/usbdevs.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/usbdevs/usbdevs.8 b/usr.sbin/usbdevs/usbdevs.8
index 24d15916a57..8f9f256c320 100644
--- a/usr.sbin/usbdevs/usbdevs.8
+++ b/usr.sbin/usbdevs/usbdevs.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: usbdevs.8,v 1.2 1998/07/13 11:01:50 augustss Exp $
+.\" $NetBSD: usbdevs.8,v 1.3 1998/07/23 13:57:51 augustss Exp $
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
@@ -41,6 +41,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl a Ar addr
+.Op Fl f Ar dev
.Op Fl v
.Sh DESCRIPTION
.Nm
@@ -52,6 +53,8 @@ The options are as follows:
.Bl -tag -width Ds
.It Fl a Ar addr
only print information about the device at the given address.
+.It Fl f Ar dev
+only print information for the given USB controller.
.It Fl v
Be verbose.
.El
diff --git a/usr.sbin/usbdevs/usbdevs.c b/usr.sbin/usbdevs/usbdevs.c
index 6e10688071b..cef81870c9e 100644
--- a/usr.sbin/usbdevs/usbdevs.c
+++ b/usr.sbin/usbdevs/usbdevs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdevs.c,v 1.3 1998/07/12 20:40:45 augustss Exp $ */
+/* $NetBSD: usbdevs.c,v 1.4 1998/07/23 13:57:51 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -55,11 +55,11 @@ void usbdump __P((int f));
void dumpone __P((char *name, int f, int addr));
int main __P((int, char **));
+extern char *__progname;
+
void
usage()
{
- extern char *__progname;
-
fprintf(stderr, "Usage: %s [-a addr] [-f dev] [-v]\n", __progname);
exit(1);
}
@@ -162,6 +162,7 @@ main(argc, argv)
extern char *optarg;
char *dev = 0;
int addr = 0;
+ int ncont;
while ((ch = getopt(argc, argv, "a:f:v")) != -1) {
switch(ch) {
@@ -183,10 +184,11 @@ main(argc, argv)
argv += optind;
if (dev == 0) {
- for (i = 0; i < 10; i++) {
+ for (ncont = 0, i = 0; i < 10; i++) {
sprintf(buf, "%s%d", USBDEV, i);
f = open(buf, O_RDONLY);
if (f >= 0) {
+ ncont++;
dumpone(buf, f, addr);
close(f);
} else {
@@ -194,6 +196,8 @@ main(argc, argv)
warn("%s", buf);
}
}
+ if (verbose && ncont == 0)
+ printf("%s: no USB controllers found\n", __progname);
} else {
f = open(dev, O_RDONLY);
if (f >= 0)