]> nmode's Git Repositories - signal-cli/commitdiff
Remove deprecated --json parameter
authorAsamK <asamk@gmx.de>
Sun, 8 Aug 2021 08:44:23 +0000 (10:44 +0200)
committerAsamK <asamk@gmx.de>
Sun, 8 Aug 2021 08:44:23 +0000 (10:44 +0200)
CHANGELOG.md
src/main/java/org/asamk/signal/commands/DaemonCommand.java
src/main/java/org/asamk/signal/commands/GetUserStatusCommand.java
src/main/java/org/asamk/signal/commands/ReceiveCommand.java

index 3de081993941d82e7dc5e19057f766b5e88f8e03..60eaa33a5a08d0f41ca3949df3619e43f70b9ff8 100644 (file)
@@ -1,6 +1,8 @@
 # Changelog
 
 ## [Unreleased]
+### Changed
+- Removed deprecated `--json` parameter, use `--output=json` instead
 
 ## [0.8.5] - 2021-08-07
 ### Added
index 334d9adbf415e2b042deabab6acc9538e5c42220..8cafea103e229107c8b919fd7ee7d94565e7b440 100644 (file)
@@ -36,9 +36,6 @@ public class DaemonCommand implements MultiLocalCommand {
         subparser.addArgument("--ignore-attachments")
                 .help("Don’t download attachments of received messages.")
                 .action(Arguments.storeTrue());
-        subparser.addArgument("--json")
-                .help("WARNING: This parameter is now deprecated! Please use the global \"--output=json\" option instead.\n\nOutput received messages in json format, one json object per line.")
-                .action(Arguments.storeTrue());
     }
 
     @Override
@@ -48,12 +45,7 @@ public class DaemonCommand implements MultiLocalCommand {
 
     @Override
     public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
-        var inJson = ns.get("output") == OutputType.JSON || ns.getBoolean("json");
-
-        // TODO delete later when "json" variable is removed
-        if (ns.getBoolean("json")) {
-            logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
-        }
+        var inJson = ns.get("output") == OutputType.JSON;
 
         boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
 
@@ -82,12 +74,7 @@ public class DaemonCommand implements MultiLocalCommand {
 
     @Override
     public void handleCommand(final Namespace ns, final List<Manager> managers) throws CommandException {
-        var inJson = ns.get("output") == OutputType.JSON || ns.getBoolean("json");
-
-        // TODO delete later when "json" variable is removed
-        if (ns.getBoolean("json")) {
-            logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
-        }
+        var inJson = ns.get("output") == OutputType.JSON;
 
         boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
 
index e6fc7c65a82706aad87991d5e56bac66469bfe3a..36b9777a9539603faff3d2c72e8e667e0b512711 100644 (file)
@@ -1,6 +1,5 @@
 package org.asamk.signal.commands;
 
-import net.sourceforge.argparse4j.impl.Arguments;
 import net.sourceforge.argparse4j.inf.Namespace;
 import net.sourceforge.argparse4j.inf.Subparser;
 
@@ -27,9 +26,6 @@ public class GetUserStatusCommand implements LocalCommand {
     public void attachToSubparser(final Subparser subparser) {
         subparser.help("Check if the specified phone number/s have been registered");
         subparser.addArgument("number").help("Phone number").nargs("+");
-        subparser.addArgument("--json")
-                .help("WARNING: This parameter is now deprecated! Please use the global \"--output=json\" option instead.\n\nOutput received messages in json format, one json object per line.")
-                .action(Arguments.storeTrue());
     }
 
     @Override
@@ -40,12 +36,7 @@ public class GetUserStatusCommand implements LocalCommand {
     @Override
     public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
         // Setup the json object mapper
-        var inJson = ns.get("output") == OutputType.JSON || ns.getBoolean("json");
-
-        // TODO delete later when "json" variable is removed
-        if (ns.getBoolean("json")) {
-            logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
-        }
+        var inJson = ns.get("output") == OutputType.JSON;
 
         // Get a map of registration statuses
         Map<String, Boolean> registered;
index b87ab2ae5f99eb729be1dc87994044dfb88ec95a..5cae9e2e899a8e723dfc2eec166beefc0ec47c9f 100644 (file)
@@ -41,9 +41,6 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
         subparser.addArgument("--ignore-attachments")
                 .help("Don’t download attachments of received messages.")
                 .action(Arguments.storeTrue());
-        subparser.addArgument("--json")
-                .help("WARNING: This parameter is now deprecated! Please use the global \"--output=json\" option instead.\n\nOutput received messages in json format, one json object per line.")
-                .action(Arguments.storeTrue());
     }
 
     @Override
@@ -54,12 +51,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
     public void handleCommand(
             final Namespace ns, final Signal signal, DBusConnection dbusconnection
     ) throws CommandException {
-        var inJson = ns.get("output") == OutputType.JSON || ns.getBoolean("json");
-
-        // TODO delete later when "json" variable is removed
-        if (ns.getBoolean("json")) {
-            logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
-        }
+        var inJson = ns.get("output") == OutputType.JSON;
 
         try {
             if (inJson) {
@@ -143,12 +135,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
 
     @Override
     public void handleCommand(final Namespace ns, final Manager m) throws CommandException {
-        var inJson = ns.get("output") == OutputType.JSON || ns.getBoolean("json");
-
-        // TODO delete later when "json" variable is removed
-        if (ns.getBoolean("json")) {
-            logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
-        }
+        var inJson = ns.get("output") == OutputType.JSON;
 
         double timeout = ns.getDouble("timeout");
         var returnOnTimeout = true;