]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/Main.java
Update Readme and fix help bug in Main
[signal-cli] / src / main / java / org / asamk / signal / Main.java
index a6d36d0f248e7880478dfe3c32baf43d30945ed6..b3664f24431408d86e28db24301e409edf1c5f7c 100644 (file)
@@ -224,6 +224,23 @@ public class Main {
                         System.exit(3);
                     }
                     break;
+                case "removeDevice":
+                    if (dBusConn != null) {
+                        System.err.println("removeDevice is not yet implemented via dbus");
+                        System.exit(1);
+                    }
+                    if (!m.isRegistered()) {
+                        System.err.println("User is not registered.");
+                        System.exit(1);
+                    }
+                    try {
+                        int deviceId = ns.getInt("deviceId");
+                        m.removeLinkedDevices(deviceId);
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                        System.exit(3);
+                    }
+                    break;
                 case "send":
                     if (dBusConn == null && !m.isRegistered()) {
                         System.err.println("User is not registered.");
@@ -487,7 +504,7 @@ public class Main {
                 .help("Show package version.")
                 .action(Arguments.version());
         parser.addArgument("--config")
-                .help("Set the path, where to store the config (Default: $HOME/.config/signal-cli).");
+                .help("Set the path, where to store the config (Default: $HOME/.config/signal).");
 
         MutuallyExclusiveGroup mut = parser.addMutuallyExclusiveGroup();
         mut.addArgument("-u", "--username")
@@ -516,6 +533,12 @@ public class Main {
 
         Subparser parserDevices = subparsers.addParser("listDevices");
 
+        Subparser parserRemoveDevice = subparsers.addParser("removeDevice");
+        parserRemoveDevice.addArgument("-d", "--deviceId")
+                .type(int.class)
+                .required(true)
+                .help("Specify the device you want to remove. Use listDevices to see the deviceIds.");
+
         Subparser parserRegister = subparsers.addParser("register");
         parserRegister.addArgument("-v", "--voice")
                 .help("The verification should be done over voice, not sms.")