summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-hwdb.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-07-02 22:23:41 +0000
committerAnthony G. Basile <blueness@gentoo.org>2013-07-07 12:13:45 -0400
commit7a3bcc197c1a655924f6c0d3de441daaa5796710 (patch)
treeafde66fc557ac8d78bba952469da8f168243ba29 /src/udev/udev-builtin-hwdb.c
parent36cac2c40ff2c62735a87ffcb84a03c578ae972f (diff)
hwdb: allow to query arbitrary keys
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-builtin-hwdb.c')
-rw-r--r--src/udev/udev-builtin-hwdb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c
index 9895f651c5..36958916c4 100644
--- a/src/udev/udev-builtin-hwdb.c
+++ b/src/udev/udev-builtin-hwdb.c
@@ -144,6 +144,13 @@ static int builtin_hwdb(struct udev_device *dev, int argc, char *argv[], bool te
}
}
+ /* query a specific key given as argument */
+ if (argv[optind]) {
+ if (udev_builtin_hwdb_lookup(dev, argv[optind], filter, test) > 0)
+ return EXIT_SUCCESS;
+ return EXIT_FAILURE;
+ }
+
/* read data from another device than the device we will store the data */
if (device) {
srcdev = udev_device_new_from_device_id(udev_device_get_udev(dev), device);