jp (blog/edit): --no-publish is a boolean option

This commit is contained in:
Goffi 2020-03-31 08:45:49 +02:00
commit 09cb00b5b1

View file

@ -468,6 +468,7 @@ class Edit(base.CommandBase, BlogPublishCommon, common.BaseEdit):
)
self.parser.add_argument(
"--no-publish",
action="store_true",
help=_('add "publish: False" to metadata'),
)
@ -510,7 +511,7 @@ class Edit(base.CommandBase, BlogPublishCommon, common.BaseEdit):
# and override metadata with command-line arguments
self.setMbDataFromArgs(mb_data)
if self.args.no_publish is not None:
if self.args.no_publish:
mb_data["publish"] = False
# then we create the file and write metadata there, as JSON dict