mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
client: add WSC argument completers
This commit is contained in:
parent
ccb3afc1f1
commit
b1d261a790
@ -90,7 +90,7 @@ client_iwctl_SOURCES = client/main.c \
|
|||||||
client/adapter.c \
|
client/adapter.c \
|
||||||
client/command.h client/command.c \
|
client/command.h client/command.c \
|
||||||
client/dbus-proxy.h client/dbus-proxy.c \
|
client/dbus-proxy.h client/dbus-proxy.c \
|
||||||
client/device.c \
|
client/device.h client/device.c \
|
||||||
client/display.h client/display.c \
|
client/display.h client/display.c \
|
||||||
client/known-networks.c \
|
client/known-networks.c \
|
||||||
client/network.h client/network.c \
|
client/network.h client/network.c \
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "dbus-proxy.h"
|
#include "dbus-proxy.h"
|
||||||
|
#include "device.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
|
|
||||||
@ -624,6 +625,13 @@ static const struct command device_commands[] = {
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
static char *family_arg_completion(const char *text, int state)
|
static char *family_arg_completion(const char *text, int state)
|
||||||
{
|
{
|
||||||
static bool first_pass;
|
static bool first_pass;
|
||||||
|
23
client/device.h
Normal file
23
client/device.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Wireless daemon for Linux
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Intel Corporation. All rights reserved.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
char *device_wsc_family_arg_completion(const char *text, int state);
|
13
client/wsc.c
13
client/wsc.c
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "dbus-proxy.h"
|
#include "dbus-proxy.h"
|
||||||
|
#include "device.h"
|
||||||
|
|
||||||
static struct proxy_interface_type wsc_interface_type = {
|
static struct proxy_interface_type wsc_interface_type = {
|
||||||
.interface = IWD_WSC_INTERFACE,
|
.interface = IWD_WSC_INTERFACE,
|
||||||
@ -63,10 +64,22 @@ static const struct command wsc_commands[] = {
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char *family_arg_completion(const char *text, int state)
|
||||||
|
{
|
||||||
|
return device_wsc_family_arg_completion(text, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *entity_arg_completion(const char *text, int state)
|
||||||
|
{
|
||||||
|
return command_entity_arg_completion(text, state, wsc_commands);
|
||||||
|
}
|
||||||
|
|
||||||
static struct command_family wsc_command_family = {
|
static struct command_family wsc_command_family = {
|
||||||
.caption = "WiFi Simple Configuration",
|
.caption = "WiFi Simple Configuration",
|
||||||
.name = "wsc",
|
.name = "wsc",
|
||||||
.command_list = wsc_commands,
|
.command_list = wsc_commands,
|
||||||
|
.family_arg_completion = family_arg_completion,
|
||||||
|
.entity_arg_completion = entity_arg_completion,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int wsc_command_family_init(void)
|
static int wsc_command_family_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user