From 6824690f140f45064157d220a24b9afbeb1d093f Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 3 Jul 2013 00:23:41 +0200 Subject: [PATCH] hwdb: allow to query arbitrary keys --- src/udev/udev-builtin-hwdb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c index 9895f651c..36958916c 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); -- 2.30.2