diff sat_frontends/jp/cmd_pubsub.py @ 3938:6939594ba77e

cli (pubsub/get): add `--no-decrypt` flag to disable automatic decryption: rel 380
author Goffi <goffi@goffi.org>
date Sat, 15 Oct 2022 20:37:00 +0200
parents 1ab5fb468a41
children 8ae3e870be94
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_pubsub.py	Sat Oct 15 20:37:00 2022 +0200
+++ b/sat_frontends/jp/cmd_pubsub.py	Sat Oct 15 20:37:00 2022 +0200
@@ -1281,9 +1281,17 @@
             default="",
             help=_("subscription id"),
         )
+        self.parser.add_argument(
+            "--no-decrypt",
+            action="store_true",
+            help=_("don't do automatic decryption of e2ee items"),
+        )
         #  TODO: a key(s) argument to select keys to display
 
     async def start(self):
+        extra = {}
+        if self.args.no_decrypt:
+            extra["decrypt"] = False
         try:
             ps_result = data_format.deserialise(
                 await self.host.bridge.psItemsGet(
@@ -1292,7 +1300,7 @@
                     self.args.max,
                     self.args.items,
                     self.args.sub_id,
-                    self.getPubsubExtra(),
+                    self.getPubsubExtra(extra),
                     self.profile,
                 )
             )