diff mbox series

[8/8] client: fix station autocomplete with multiple phys

Message ID 20220810231621.372514-8-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/8] network: make network const in network_bss_list_get_entries | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Aug. 10, 2022, 11:16 p.m. UTC
The limitations of readline required that the autocompletion choose
a 'default' device. With multiple phys this doesn't work. Now the
readline limitation has been worked around and station can look up
the device for the command completion.
---
 client/station.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Denis Kenzior Aug. 11, 2022, 2:48 p.m. UTC | #1
Hi James,

On 8/10/22 18:16, James Prestwood wrote:
> The limitations of readline required that the autocompletion choose
> a 'default' device. With multiple phys this doesn't work. Now the
> readline limitation has been worked around and station can look up
> the device for the command completion.

So should you get rid of device_get_default() now as well?

> ---
>   client/station.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 

Regards,
-Denis
diff mbox series

Patch

diff --git a/client/station.c b/client/station.c
index 90291c88..b070807b 100644
--- a/client/station.c
+++ b/client/station.c
@@ -280,7 +280,8 @@  static enum cmd_status cmd_list(const char *device_name, char **argv, int argc)
 static char *connect_cmd_arg_completion(const char *text, int state,
 					const char *device_name)
 {
-	const struct proxy_interface *device = device_get_default();
+	const struct proxy_interface *device = device_proxy_find(device_name,
+							IWD_STATION_INTERFACE);
 
 	if (!device)
 		return NULL;