diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -2136,11 +2136,15 @@ #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX) printf(" --headless Run without a GUI.\n"); #endif #if defined(MOZ_ENABLE_DBUS) - printf(" --dbus-service Run as DBus service.\n"); + printf( + " --dbus-service Run as DBus service for " + "org.freedesktop.Application and\n" + " set a launcher (usually /usr/bin/appname " + "script) for it."); #endif // this works, but only after the components have registered. so if you drop // in a new command line handler, --help won't not until the second run. out // of the bug, because we ship a component.reg file, it works correctly. @@ -4378,17 +4382,24 @@ *aExitFlag = true; return 0; } #ifdef MOZ_ENABLE_DBUS - if (CheckArg("dbus-service")) { - UniquePtr dbusService = MakeUnique(gArgv[0]); + const char* dbusServiceLauncher = nullptr; + ar = CheckArg("dbus-service", &dbusServiceLauncher, CheckArgFlag::None); + if (ar == ARG_BAD) { + Output(true, "Missing launcher param for --dbus-service\n"); + return 1; + } + if (ar == ARG_FOUND) { + UniquePtr dbusService = + MakeUnique(dbusServiceLauncher); if (dbusService->Init()) { dbusService->Run(); } *aExitFlag = true; - return 1; + return 0; } #endif rv = XRE_InitCommandLine(gArgc, gArgv); NS_ENSURE_SUCCESS(rv, 1);