Mercurial > libervia-backend
comparison libervia/cli/cmd_message.py @ 4327:554a87ae17a6
plugin XEP-0048, XEP-0402; CLI (bookmarks): implement XEP-0402 (PEP Native Bookmarks):
- Former bookmarks implementation is now labeled as "legacy".
- XEP-0402 is now used for bookmarks when relevant namespaces are found, and it fallbacks
to legacy XEP-0048/XEP-0049 bookmarks otherwise.
- CLI legacy bookmark commands have been moved to `bookmarks legacy`
- CLI bookmarks commands now use the new XEP-0402 (with fallback to legacy one
automatically used if necessary).
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 20 Nov 2024 11:43:27 +0100 |
parents | 1795bfcc38e7 |
children |
comparison
equal
deleted
inserted
replaced
4326:5fd6a4dc2122 | 4327:554a87ae17a6 |
---|---|
114 ) | 114 ) |
115 | 115 |
116 addressing_group = self.parser.add_argument_group( | 116 addressing_group = self.parser.add_argument_group( |
117 "addressing commands", | 117 "addressing commands", |
118 description="Commands to add addressing metadata, and/or to send message to " | 118 description="Commands to add addressing metadata, and/or to send message to " |
119 "multiple recipients." | 119 "multiple recipients.", |
120 ) | 120 ) |
121 for arg_name in RECIPIENTS_ARGS: | 121 for arg_name in RECIPIENTS_ARGS: |
122 addressing_group.add_argument( | 122 addressing_group.add_argument( |
123 f"--{arg_name}", | 123 f"--{arg_name}", |
124 nargs="+", | 124 nargs="+", |
125 action="append", | 125 action="append", |
126 metavar=("JID", "DESCRIPTION"), | 126 metavar=("JID", "DESCRIPTION"), |
127 help=f'extra "{arg_name.upper()}" recipient(s), may be used several ' | 127 help=f'extra "{arg_name.upper()}" recipient(s), may be used several ' |
128 'times', | 128 "times", |
129 ) | 129 ) |
130 for arg_name in REPLY_ARGS: | 130 for arg_name in REPLY_ARGS: |
131 addressing_group.add_argument( | 131 addressing_group.add_argument( |
132 f"--{arg_name}", | 132 f"--{arg_name}", |
133 nargs="+", | 133 nargs="+", |
134 action="append", | 134 action="append", |
135 metavar=("JID", "DESCRIPTION"), | 135 metavar=("JID", "DESCRIPTION"), |
136 help=f'ask to reply to this JID, may be used several ' | 136 help=f"ask to reply to this JID, may be used several times", |
137 'times', | |
138 ) | 137 ) |
139 addressing_group.add_argument( | 138 addressing_group.add_argument( |
140 "--no-reply", | 139 "--no-reply", |
141 action="store_true", | 140 action="store_true", |
142 help="flag this message as not requiring replies" | 141 help="flag this message as not requiring replies", |
143 ) | 142 ) |
144 syntax = self.parser.add_mutually_exclusive_group() | 143 syntax = self.parser.add_mutually_exclusive_group() |
145 syntax.add_argument("-x", "--xhtml", action="store_true", help=_("XHTML body")) | 144 syntax.add_argument("-x", "--xhtml", action="store_true", help=_("XHTML body")) |
146 syntax.add_argument("-r", "--rich", action="store_true", help=_("rich body")) | 145 syntax.add_argument("-r", "--rich", action="store_true", help=_("rich body")) |
147 self.parser.add_argument("jid", help=_("the destination jid")) | 146 self.parser.add_argument("jid", help=_("the destination jid")) |