mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
client: add completion for the cmds without entity
This commit is contained in:
parent
8eaeb66220
commit
b530f4fb77
24
client/wsc.c
24
client/wsc.c
@ -199,6 +199,30 @@ static const struct command wsc_commands[] = {
|
||||
|
||||
static char *family_arg_completion(const char *text, int state)
|
||||
{
|
||||
static bool first_pass;
|
||||
static size_t index;
|
||||
static size_t len;
|
||||
const char *cmd;
|
||||
|
||||
if (!state) {
|
||||
index = 0;
|
||||
len = strlen(text);
|
||||
first_pass = true;
|
||||
}
|
||||
|
||||
while ((cmd = wsc_commands[index].cmd)) {
|
||||
if (wsc_commands[index++].entity)
|
||||
continue;
|
||||
|
||||
if (!strncmp(cmd, text, len))
|
||||
return l_strdup(cmd);
|
||||
}
|
||||
|
||||
if (first_pass) {
|
||||
state = 0;
|
||||
first_pass = false;
|
||||
}
|
||||
|
||||
return device_wsc_family_arg_completion(text, state);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user