diff sat_frontends/jp/cmd_pubsub.py @ 2764:92af49cde255

jp (base): MAM and RSM arguments can now be used for pubsub commands: - RSM and MAM args arguments have been added to pubsub group, and activated when multiple items are possible - /!\ --max-items (i.e. pubsub original max) short option has been change for -M, and -m is now used for RSM max - pubsub/search -m option has been renamed -M for same reason as above - pubsub/search -o option has been replaced by -k (for keep), to avoid conflict with order-by (and long version is now --node-max)
author Goffi <goffi@goffi.org>
date Fri, 11 Jan 2019 10:18:02 +0100
parents 4b693ea24d5f
children 003b8b4b56a7
line wrap: on
line diff
--- a/sat_frontends/jp/cmd_pubsub.py	Fri Jan 11 09:48:19 2019 +0100
+++ b/sat_frontends/jp/cmd_pubsub.py	Fri Jan 11 10:18:02 2019 +0100
@@ -1021,12 +1021,19 @@
 
 
 class Search(base.CommandBase):
-    """this command to a search without using MAM, i.e. by checking every items if dound by itself, so it may be heavy in resources both for server and client"""
+    """this command do a search without using MAM
+
+    This commands checks every items it finds by itself,
+    so it may be heavy in resources both for server and client
+    """
 
     RE_FLAGS = re.MULTILINE | re.UNICODE
     EXEC_ACTIONS = (u"exec", u"external")
 
     def __init__(self, host):
+        # FIXME: C.NO_MAX is not needed here, and this can be globally removed from consts
+        #        the only interest is to change the help string, but this can be explained
+        #        extensively in man pages (max is for each node found)
         base.CommandBase.__init__(
             self,
             host,
@@ -1067,15 +1074,12 @@
             ),
         )
         self.parser.add_argument(
-            "-m",
-            "--max",
+            "-M",
+            "--node-max",
             type=int,
             default=30,
-            help=_(
-                u"maximum number of items to get per node ({} to get all items, default: 30)".format(
-                    C.NO_LIMIT
-                )
-            ),
+            help=_(u"maximum number of items to get per node ({} to get all items, "
+                   u"default: 30)".format( C.NO_LIMIT)),
         )
         self.parser.add_argument(
             "-N",
@@ -1178,7 +1182,7 @@
             help=_(u"(don't) use DOTALL option for regex (default: don't use)"),
         )
         flags.add_argument(
-            "-o",
+            "-k",
             "--only-matching",
             action="append",
             dest="filters",