comparison libervia/cli/cmd_blog.py @ 4173:7df6ba11bdae

cli (blog): add `--no-id-suffix` flag, to prevent adding random suffix to user-friendly IDs
author Goffi <goffi@goffi.org>
date Tue, 05 Dec 2023 13:12:01 +0100
parents 47401850dec6
children 121925996ffb
comparison
equal deleted inserted replaced
4172:0e48181d50ab 4173:7df6ba11bdae
180 "--no-comments", 180 "--no-comments",
181 action="store_const", 181 action="store_const",
182 const=False, 182 const=False,
183 dest="comments", 183 dest="comments",
184 help=_("disable comments (will remove comments node if it exist)"), 184 help=_("disable comments (will remove comments node if it exist)"),
185 )
186
187 self.parser.add_argument(
188 "--no-id-suffix",
189 action="store_true",
190 help=_("do no add random suffix to friendly ID")
185 ) 191 )
186 192
187 self.parser.add_argument( 193 self.parser.add_argument(
188 "-S", 194 "-S",
189 "--syntax", 195 "--syntax",
274 mb_data["tags"] = self.args.tag 280 mb_data["tags"] = self.args.tag
275 if self.args.title is not None: 281 if self.args.title is not None:
276 mb_data["title"] = self.args.title 282 mb_data["title"] = self.args.title
277 if self.args.language is not None: 283 if self.args.language is not None:
278 mb_data["language"] = self.args.language 284 mb_data["language"] = self.args.language
285 if self.args.no_id_suffix:
286 mb_data["user_friendly_id_suffix"] = False
279 if self.args.encrypt: 287 if self.args.encrypt:
280 mb_data["encrypted"] = True 288 mb_data["encrypted"] = True
281 if self.args.sign: 289 if self.args.sign:
282 mb_data["signed"] = True 290 mb_data["signed"] = True
283 if self.args.encrypt_for: 291 if self.args.encrypt_for: