From 8eaeb66220130997684bc2ffbb2c802eeac18b6c Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Fri, 12 May 2017 14:36:49 -0700 Subject: [PATCH] client: check for WSC-capability in arg completion --- client/device.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/device.c b/client/device.c index 4a9d2cc1..07cfe25f 100644 --- a/client/device.c +++ b/client/device.c @@ -434,6 +434,13 @@ static bool match_by_partial_name(const void *a, const void *b) return !strncmp(device->name, text, strlen(text)); } +static bool match_by_partial_name_and_wsc(const void *a, const void *b) +{ + const struct device *device = a; + + return match_by_partial_name(a, b) && device->wsc ? true : false; +} + static const struct proxy_interface *get_device_proxy_by_name( const char *device_name) { @@ -665,8 +672,8 @@ const struct proxy_interface *device_wsc_get(const char *device_name) char *device_wsc_family_arg_completion(const char *text, int state) { return proxy_property_str_completion(&device_interface_type, - match_by_partial_name, "Name", - text, state); + match_by_partial_name_and_wsc, + "Name", text, state); } static char *family_arg_completion(const char *text, int state)