diff --git a/docs/reference/gio/gdbus.xml b/docs/reference/gio/gdbus.xml
index 280b47873..75e7eeb03 100644
--- a/docs/reference/gio/gdbus.xml
+++ b/docs/reference/gio/gdbus.xml
@@ -48,6 +48,9 @@
--dest bus_name
--object-path /path/to/object
--method org.project.InterfaceName.MethodName
+
+ --timeout seconds
+
ARG1
ARG2
diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index 56efd40b4..9228122e2 100644
--- a/gio/gdbus-tool.c
+++ b/gio/gdbus-tool.c
@@ -527,12 +527,14 @@ _g_variant_parse_me_harder (GVariantType *type,
static gchar *opt_call_dest = NULL;
static gchar *opt_call_object_path = NULL;
static gchar *opt_call_method = NULL;
+static gint opt_call_timeout = -1;
static const GOptionEntry call_entries[] =
{
{ "dest", 'd', 0, G_OPTION_ARG_STRING, &opt_call_dest, N_("Destination name to invoke method on"), NULL},
{ "object-path", 'o', 0, G_OPTION_ARG_STRING, &opt_call_object_path, N_("Object path to invoke method on"), NULL},
{ "method", 'm', 0, G_OPTION_ARG_STRING, &opt_call_method, N_("Method and interface name"), NULL},
+ { "timeout", 't', 0, G_OPTION_ARG_INT, &opt_call_timeout, N_("Timeout in seconds"), NULL},
{ NULL }
};
@@ -809,7 +811,7 @@ handle_call (gint *argc,
parameters,
NULL,
G_DBUS_CALL_FLAGS_NONE,
- -1,
+ opt_call_timeout > 0 ? opt_call_timeout * 1000 : opt_call_timeout,
NULL,
&error);
if (result == NULL)