diff options
author | imp <imp@FreeBSD.org> | 2007-06-30 03:58:01 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2007-06-30 03:58:01 +0000 |
commit | e3b9f0fc2d5cc18662a37cb7c89500cc95d34e38 (patch) | |
tree | 7d8e679ad7c66187d9e3101ede31755edc420a99 /usr.bin/usbhidaction | |
parent | 665642a3f2aeadb5d5bd42bab15d52f405ec6b1c (diff) | |
download | FreeBSD-src-e3b9f0fc2d5cc18662a37cb7c89500cc95d34e38.zip FreeBSD-src-e3b9f0fc2d5cc18662a37cb7c89500cc95d34e38.tar.gz |
Add support using an alternate table file to usbhidaction(1).
Submitted by: Michael Haro
PR: 61234
Approved by: re (bmah)
Diffstat (limited to 'usr.bin/usbhidaction')
-rw-r--r-- | usr.bin/usbhidaction/usbhidaction.1 | 3 | ||||
-rw-r--r-- | usr.bin/usbhidaction/usbhidaction.c | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/usbhidaction/usbhidaction.1 b/usr.bin/usbhidaction/usbhidaction.1 index 4c0f6a3..95420c8f 100644 --- a/usr.bin/usbhidaction/usbhidaction.1 +++ b/usr.bin/usbhidaction/usbhidaction.1 @@ -47,6 +47,7 @@ .Fl c Ar config-file .Fl f Ar device .Op Fl p Ar pidfile +.Op Fl t Ar tablefile .Ar arg ... .Sh DESCRIPTION The @@ -73,6 +74,8 @@ Ignore HID items in the configuration file that do not exist in the device. Be verbose, and do not become a daemon. .It Fl c Ar config-file Specify a path name for the configuration file. +.It Fl t Ar tablefile +Specify a path name for the HID usage table file. .It Fl f Ar device Specify a path name for the device to operate on. If diff --git a/usr.bin/usbhidaction/usbhidaction.c b/usr.bin/usbhidaction/usbhidaction.c index e1f67b0..e0d459d 100644 --- a/usr.bin/usbhidaction/usbhidaction.c +++ b/usr.bin/usbhidaction/usbhidaction.c @@ -93,6 +93,7 @@ main(int argc, char **argv) { const char *conf = NULL; const char *dev = NULL; + const char *table = NULL; int fd, fp, ch, n, val, i; size_t sz, sz1; int demon, ignore, dieearly; @@ -105,7 +106,7 @@ main(int argc, char **argv) demon = 1; ignore = 0; dieearly = 0; - while ((ch = getopt(argc, argv, "c:def:ip:v")) != -1) { + while ((ch = getopt(argc, argv, "c:def:ip:t:v")) != -1) { switch(ch) { case 'c': conf = optarg; @@ -125,6 +126,9 @@ main(int argc, char **argv) case 'p': pidfile = optarg; break; + case 't': + table = optarg; + break; case 'v': demon = 0; verbose++; @@ -140,7 +144,7 @@ main(int argc, char **argv) if (conf == NULL || dev == NULL) usage(); - hid_init(NULL); + hid_init(table); if (dev[0] != '/') { snprintf(devnamebuf, sizeof(devnamebuf), "/dev/%s%s", @@ -245,7 +249,7 @@ usage(void) { fprintf(stderr, "Usage: %s [-deiv] -c config_file -f hid_dev " - "[-p pidfile]\n", getprogname()); + "[-p pidfile] [-t tablefile]\n", getprogname()); exit(1); } |