]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/Main.java
Added JSON output to listGroups and allowed json to be activated with -j (#401)
[signal-cli] / src / main / java / org / asamk / signal / Main.java
index b920963184ed7c038f9fd280fd489aebbb449869..b90b7cba1ad0706fb2ee1c0edb461868210f7f11 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-  Copyright (C) 2015-2020 AsamK and contributors
+  Copyright (C) 2015-2021 AsamK and contributors
 
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
 
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -299,6 +299,9 @@ public class Main {
         mut.addArgument("--dbus").help("Make request via user dbus.").action(Arguments.storeTrue());
         mut.addArgument("--dbus-system").help("Make request via system dbus.").action(Arguments.storeTrue());
 
         mut.addArgument("--dbus").help("Make request via user dbus.").action(Arguments.storeTrue());
         mut.addArgument("--dbus-system").help("Make request via system dbus.").action(Arguments.storeTrue());
 
+        parser.addArgument("-o", "--output").help("Choose to output in plain text or JSON")
+                .choices("plain-text", "json").setDefault("plain-text");
+
         Subparsers subparsers = parser.addSubparsers()
                 .title("subcommands")
                 .dest("command")
         Subparsers subparsers = parser.addSubparsers()
                 .title("subcommands")
                 .dest("command")