From 75170711a3486384ca3d66563c4b011a2505af39 Mon Sep 17 00:00:00 2001 From: Peter Grasch Date: Wed, 31 Aug 2011 11:31:59 +0200 Subject: Introducing --address parameter to qdbus Merge-request: 1363 Reviewed-by: Frederik Gladhorn --- tools/qdbus/qdbus/qdbus.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp index 14b4b9e..4e90418 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,10 @@ int main(int argc, char **argv) if (arg == QLatin1String("--system")) { connection = QDBusConnection::systemBus(); connectionOpened = true; + } else + if (arg == QLatin1String("--address")) { + connection = QDBusConnection::connectToBus(args.takeFirst(), "bus"); + connectionOpened = true; } else if (arg == QLatin1String("--literal")) { printArgumentsLiterally = true; } else if (arg == QLatin1String("--help")) { -- cgit v0.12