summaryrefslogtreecommitdiffstats
path: root/lspcidrake.c
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2002-07-16 14:54:45 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2002-07-16 14:54:45 +0000
commit667f94e4543832186ed073bbefa5873096f9c369 (patch)
tree710ffff3a79b3f4d99ce1940079c154bf7da1348 /lspcidrake.c
parentf37544e3e0ec9f33b8440dac9fba28637415d494 (diff)
downloadldetect-667f94e4543832186ed073bbefa5873096f9c369.tar
ldetect-667f94e4543832186ed073bbefa5873096f9c369.tar.gz
ldetect-667f94e4543832186ed073bbefa5873096f9c369.tar.bz2
ldetect-667f94e4543832186ed073bbefa5873096f9c369.tar.xz
ldetect-667f94e4543832186ed073bbefa5873096f9c369.zip
- move usb devices proc entry path into
libldetect-private.h::proc_usb_path - add -u option so that lspcidrake can read usb devices from a file in order to understand what happened to remote testers - make if (test) action clearer by rejecting action singleton in next line - lspcidrake: describe all options
Diffstat (limited to 'lspcidrake.c')
-rw-r--r--lspcidrake.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lspcidrake.c b/lspcidrake.c
index fccecb3..ace91e4 100644
--- a/lspcidrake.c
+++ b/lspcidrake.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <string.h>
#include "libldetect.h"
+#include "libldetect-private.h"
static int verboze = 0;
@@ -14,7 +15,8 @@ static void printit(struct pciusb_entries entries, const char *(find_class)(unsi
else printf("unknown (%04x/%04x/%04x/%04x)", e->vendor, e->device, e->subvendor, e->subdevice);
if (e->class_) {
const char *class_ = find_class(e->class_);
- if (strcmp(class_, "NOT_DEFINED") != 0) printf(" [%s]", class_);
+ if (strcmp(class_, "NOT_DEFINED") != 0)
+ printf(" [%s]", class_);
}
if (verboze && e->text) {
printf(" (vendor:%04x device:%04x", e->vendor, e->device);
@@ -25,7 +27,6 @@ static void printit(struct pciusb_entries entries, const char *(find_class)(unsi
printf("\n");
}
pciusb_free(&entries);
-
}
@@ -35,7 +36,11 @@ int main(int argc, char **argv) {
while (ptr && *ptr) {
if (!strcmp(*ptr, "-h") || !strcmp(*ptr, "--help")) {
- printf("usage: lspcidrake [-v] [-f]\n");
+ printf("usage: lspcidrake [-v|-f|-u]\n"
+ "-f : full probe\n"
+ "-u : usb devices source [/proc/usb/devices by default\n"
+ "-v : verbose mode [print ids and sub-ids], implies full probe\n"
+ );
return 0;
}
if (!strcmp(*ptr, "-v")) {
@@ -44,6 +49,8 @@ int main(int argc, char **argv) {
}
if (!strcmp(*ptr, "-f"))
full_probe = 1;
+ if (!strcmp(*ptr, "-u"))
+ proc_usb_path = *++ptr;
ptr++;
}