mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Add --bus-name option to use different D-Bus bus name
This commit is contained in:
parent
a48fdaf8b7
commit
1bf703b012
8 changed files with 98 additions and 53 deletions
|
@ -76,6 +76,10 @@ public class App {
|
|||
.dest("global-dbus-system")
|
||||
.help("Make request via system dbus.")
|
||||
.action(Arguments.storeTrue());
|
||||
parser.addArgument("--bus-name")
|
||||
.dest("global-bus-name")
|
||||
.setDefault(DbusConfig.getBusname())
|
||||
.help("Specify the D-Bus bus name to connect to.");
|
||||
|
||||
parser.addArgument("-o", "--output")
|
||||
.help("Choose to output in plain text or JSON")
|
||||
|
@ -125,8 +129,9 @@ public class App {
|
|||
final var useDbus = Boolean.TRUE.equals(ns.getBoolean("global-dbus"));
|
||||
final var useDbusSystem = Boolean.TRUE.equals(ns.getBoolean("global-dbus-system"));
|
||||
if (useDbus || useDbusSystem) {
|
||||
final var busName = ns.getString("global-bus-name");
|
||||
// If account is null, it will connect to the default object path
|
||||
initDbusClient(command, account, useDbusSystem, commandHandler);
|
||||
initDbusClient(command, account, useDbusSystem, busName, commandHandler);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue