From bfadf0a427debe24e28e16ca22c6cc8ef54a8373 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 4 Mar 2024 21:09:39 +1100 Subject: [PATCH] [host] app: print list of valid capture interfaces --- host/src/app.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/host/src/app.c b/host/src/app.c index e97026da..a17ec5e7 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -123,6 +123,18 @@ static bool validateCaptureBackend(struct Option * opt, const char ** error) return false; } +static StringList getValuesCaptureBackend(struct Option * opt) +{ + StringList sl = stringlist_new(false); + if (!sl) + return NULL; + + for (int i = 0; CaptureInterfaces[i]; ++i) + stringlist_push(sl, (char *)CaptureInterfaces[i]->shortName); + + return sl; +} + static struct Option options[] = { { @@ -132,6 +144,7 @@ static struct Option options[] = .type = OPTION_TYPE_STRING, .value.x_string = "", .validator = validateCaptureBackend, + .getValues = getValuesCaptureBackend }, { .module = "app",