]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/commands/RemoteDeleteCommand.java
Improve command line help
[signal-cli] / src / main / java / org / asamk / signal / commands / RemoteDeleteCommand.java
index 796a3344d9007e793d2e93b4fd434ad0d64e28be..8efd581bd6de287db202b4904fc9f86049dbc175 100644 (file)
@@ -15,8 +15,6 @@ import org.freedesktop.dbus.exceptions.DBusExecutionException;
 
 import java.util.List;
 
-import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
-
 public class RemoteDeleteCommand implements DbusCommand {
 
     @Override
@@ -26,10 +24,8 @@ public class RemoteDeleteCommand implements DbusCommand {
                 .required(true)
                 .type(long.class)
                 .help("Specify the timestamp of the message to delete.");
-        subparser.addArgument("-g", "--group")
-                .help("Specify the recipient group ID.");
-        subparser.addArgument("recipient")
-                .help("Specify the recipients' phone number.").nargs("*");
+        subparser.addArgument("-g", "--group").help("Specify the recipient group ID.");
+        subparser.addArgument("recipient").help("Specify the recipients' phone number.").nargs("*");
     }
 
     @Override
@@ -45,7 +41,7 @@ public class RemoteDeleteCommand implements DbusCommand {
             throw new UserErrorException("You cannot specify recipients by phone number and groups at the same time");
         }
 
-        final long targetTimestamp = ns.getLong("target_timestamp");
+        final long targetTimestamp = ns.getLong("target-timestamp");
 
         final var writer = new PlainTextWriterImpl(System.out);
 
@@ -66,9 +62,6 @@ public class RemoteDeleteCommand implements DbusCommand {
                 timestamp = signal.sendRemoteDeleteMessage(targetTimestamp, recipients);
             }
             writer.println("{}", timestamp);
-        } catch (AssertionError e) {
-            handleAssertionError(e);
-            throw e;
         } catch (UnknownObject e) {
             throw new UserErrorException("Failed to find dbus object, maybe missing the -u flag: " + e.getMessage());
         } catch (Signal.Error.InvalidNumber e) {