Update man page.
Be a little more verbose with -v when no controllers were found.
This commit is contained in:
parent
02c8f266db
commit
cf835b8a8d
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue