[glib/wip/kdbus-junk: 33/37] gdbus-tool: add support for new bus types
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/kdbus-junk: 33/37] gdbus-tool: add support for new bus types
- Date: Wed, 10 Dec 2014 16:00:00 +0000 (UTC)
commit c43029992def12c58b0ec297ff85f93d08880624
Author: Ryan Lortie <desrt desrt ca>
Date: Tue Dec 2 14:45:30 2014 -0500
gdbus-tool: add support for new bus types
Add support for 'machine' and 'user' busses to the commandline tool.
gio/gdbus-tool.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index db23b43..f17a579 100644
--- a/gio/gdbus-tool.c
+++ b/gio/gdbus-tool.c
@@ -351,8 +351,8 @@ static const GOptionEntry connection_entries[] =
{
{ "system", 'y', 0, G_OPTION_ARG_NONE, &opt_connection_system, N_("Connect to the system bus"), NULL},
{ "session", 'e', 0, G_OPTION_ARG_NONE, &opt_connection_session, N_("Connect to the session bus"), NULL},
- { "user", 'u', 0, G_OPTION_ARG_NONE, &opt_connection_user, N_("Connect to the system bus"), NULL},
- { "machine", 'm', 0, G_OPTION_ARG_NONE, &opt_connection_machine, N_("Connect to the session bus"), NULL},
+ { "machine", 'm', 0, G_OPTION_ARG_NONE, &opt_connection_machine, N_("Connect to the machine bus"), NULL},
+ { "user", 'u', 0, G_OPTION_ARG_NONE, &opt_connection_user, N_("Connect to the user bus"), NULL},
{ "address", 'a', 0, G_OPTION_ARG_STRING, &opt_connection_address, N_("Connect to given D-Bus address"),
NULL},
{ NULL }
};
@@ -383,6 +383,8 @@ connection_get_dbus_connection (GError **error)
count = !!opt_connection_system +
!!opt_connection_session +
+ !!opt_connection_machine +
+ !!opt_connection_user +
!!opt_connection_address;
/* First, ensure we have exactly one connect */
@@ -411,6 +413,14 @@ connection_get_dbus_connection (GError **error)
{
c = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error);
}
+ else if (opt_connection_machine)
+ {
+ c = g_bus_get_sync (G_BUS_TYPE_MACHINE, NULL, error);
+ }
+ else if (opt_connection_user)
+ {
+ c = g_bus_get_sync (G_BUS_TYPE_USER, NULL, error);
+ }
else if (opt_connection_address != NULL)
{
c = g_dbus_connection_new_for_address_sync (opt_connection_address,
@@ -603,7 +613,7 @@ handle_emit (gint *argc,
}
else
{
- g_print ("--system \n--session \n--address \n");
+ g_print ("--system \n--session \n--machine \n--user \n--address \n");
}
}
else
@@ -835,7 +845,7 @@ handle_call (gint *argc,
}
else
{
- g_print ("--system \n--session \n--address \n");
+ g_print ("--system \n--session \n--machine \n--user \n--address \n");
}
}
else
@@ -1570,7 +1580,7 @@ handle_introspect (gint *argc,
}
else
{
- g_print ("--system \n--session \n--address \n");
+ g_print ("--system \n--session \n--machine \n--user \n--address \n");
}
}
else
@@ -1798,7 +1808,7 @@ handle_monitor (gint *argc,
}
else
{
- g_print ("--system \n--session \n--address \n");
+ g_print ("--system \n--session \n--machine \n--user \n--address \n");
}
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]