summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/qdbus/qdbus/qdbus.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp
index 14b4b9e..757267f 100644
--- a/tools/qdbus/qdbus/qdbus.cpp
+++ b/tools/qdbus/qdbus/qdbus.cpp
@@ -59,7 +59,7 @@ static bool printArgumentsLiterally = false;
static void showUsage()
{
- printf("Usage: qdbus [--system] [--literal] [servicename] [path] [method] [args]\n"
+ printf("Usage: qdbus [--system | --address ADDRESS] [--literal] [servicename] [path] [method] [args]\n"
"\n"
" servicename the service to connect to (e.g., org.freedesktop.DBus)\n"
" path the path to the object (e.g., /)\n"
@@ -71,6 +71,7 @@ static void showUsage()
"\n"
"Options:\n"
" --system connect to the system bus\n"
+ " --address ADDRESS connect to the given bus\n"
" --literal print replies literally\n");
}
@@ -454,6 +455,11 @@ int main(int argc, char **argv)
if (arg == QLatin1String("--system")) {
connection = QDBusConnection::systemBus();
connectionOpened = true;
+ } else if (arg == QLatin1String("--address")) {
+ if (!args.isEmpty()) {
+ connection = QDBusConnection::connectToBus(args.takeFirst(), "bus");
+ connectionOpened = true;
+ }
} else if (arg == QLatin1String("--literal")) {
printArgumentsLiterally = true;
} else if (arg == QLatin1String("--help")) {