aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/usbhidaction
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2007-06-30 03:58:01 +0000
committerWarner Losh <imp@FreeBSD.org>2007-06-30 03:58:01 +0000
commit986bd8412b2de7b8e1dc35bbeeccb9b981e0b29d (patch)
tree7d8e679ad7c66187d9e3101ede31755edc420a99 /usr.bin/usbhidaction
parent006bd3063f61b4b571e6073c615916901e9cab59 (diff)
downloadsrc-986bd8412b2de7b8e1dc35bbeeccb9b981e0b29d.tar.gz
src-986bd8412b2de7b8e1dc35bbeeccb9b981e0b29d.zip
Notes
Diffstat (limited to 'usr.bin/usbhidaction')
-rw-r--r--usr.bin/usbhidaction/usbhidaction.13
-rw-r--r--usr.bin/usbhidaction/usbhidaction.c10
2 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/usbhidaction/usbhidaction.1 b/usr.bin/usbhidaction/usbhidaction.1
index 4c0f6a36574e..95420c8f7914 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 e1f67b00b4db..e0d459d2c2b3 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);
}