summaryrefslogtreecommitdiffstats
path: root/commands/drvinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/drvinfo.c')
-rw-r--r--commands/drvinfo.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/commands/drvinfo.c b/commands/drvinfo.c
index 9f8f971ee9..e13b04870e 100644
--- a/commands/drvinfo.c
+++ b/commands/drvinfo.c
@@ -5,15 +5,21 @@
#include <common.h>
#include <command.h>
#include <driver.h>
+#include <complete.h>
+#include <fnmatch.h>
static int do_drvinfo(int argc, char *argv[])
{
- struct driver_d *drv;
- struct device_d *dev;
+ char *pattern = argv[1];
+ struct driver *drv;
+ struct device *dev;
printf("Driver\tDevice(s)\n");
printf("--------------------\n");
for_each_driver(drv) {
+ if (pattern && fnmatch(pattern, drv->name, 0))
+ continue;
+
printf("%s\n",drv->name);
for_each_device(dev) {
if (dev->driver == drv)
@@ -31,5 +37,7 @@ static int do_drvinfo(int argc, char *argv[])
BAREBOX_CMD_START(drvinfo)
.cmd = do_drvinfo,
BAREBOX_CMD_DESC("list compiled-in device drivers")
+ BAREBOX_CMD_OPTS("[DRIVER]")
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
+ BAREBOX_CMD_COMPLETE(driver_complete)
BAREBOX_CMD_END