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)
This commit is contained in:
Goffi 2019-01-11 10:18:02 +01:00
commit fa0179f87e

View file

@ -1021,12 +1021,19 @@ class Affiliations(base.CommandBase):
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 @@ class Search(base.CommandBase):
),
)
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 @@ class Search(base.CommandBase):
help=_(u"(don't) use DOTALL option for regex (default: don't use)"),
)
flags.add_argument(
"-o",
"-k",
"--only-matching",
action="append",
dest="filters",