3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

client: Only print daemon info in interactive mode

This commit is contained in:
Denis Kenzior 2021-10-26 07:48:33 -05:00
parent 93a06769c4
commit 062fc7852a

View File

@ -30,6 +30,7 @@
#include "client/dbus-proxy.h"
#include "client/display.h"
#include "client/command.h"
#include "client/daemon.h"
static bool netconfig_enabled;
@ -62,12 +63,23 @@ static void get_info_callback(struct l_dbus_message *message, void *user_data)
}
while (l_dbus_message_iter_next_entry(&iter, &key, &variant)) {
if (!strcmp(key, "NetworkConfigurationEnabled") &&
l_dbus_message_iter_get_variant(&variant, "b",
&netconfig_enabled))
display("%s: %s\n", key,
if (strcmp(key, "NetworkConfigurationEnabled"))
continue;
l_dbus_message_iter_get_variant(&variant, "b",
&netconfig_enabled);
break;
}
if (!command_is_interactive_mode())
return;
l_dbus_message_get_arguments(message, "a{sv}", &iter);
display("NetworkConfigurationEnabled: %s\n",
netconfig_enabled ? "enabled" : "disabled");
else if (!strcmp(key, "Version") ||
while (l_dbus_message_iter_next_entry(&iter, &key, &variant)) {
if (!strcmp(key, "Version") ||
!strcmp(key, "StateDirectory")) {
const char *sval;