summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-07-03 00:23:41 +0200
committerKay Sievers <kay@vrfy.org>2013-07-03 00:23:41 +0200
commit6824690f140f45064157d220a24b9afbeb1d093f (patch)
tree88f8d3ef5364d5b8930972447cd5c1225aeb73d7 /src
parent2c4c73b3ffa123cc5c69f5749c58706aafb3f257 (diff)
hwdb: allow to query arbitrary keys
Diffstat (limited to 'src')
-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);