comparison sat_frontends/jp/cmd_blog.py @ 2808:51c53fc4fc4a

jp (blog/edit): changed comments handling: "-C" now allow comment and "--no-comments" explicitly disable it. This way when none of this option is used, the current state of the item is kept without deleting accidentaly the comments node.
author Goffi <goffi@goffi.org>
date Sat, 23 Feb 2019 19:00:25 +0100
parents 0b7ce5daee9b
children 2f39682f6d40
comparison
equal deleted inserted replaced
2807:0b7ce5daee9b 2808:51c53fc4fc4a
114 "--tag", 114 "--tag",
115 type=base.unicode_decoder, 115 type=base.unicode_decoder,
116 action="append", 116 action="append",
117 help=_(u"tag (category) of your item"), 117 help=_(u"tag (category) of your item"),
118 ) 118 )
119 self.parser.add_argument( 119
120 "-C", "--comments", action="store_true", help=_(u"enable comments") 120 comments_group = self.parser.add_mutually_exclusive_group()
121 ) 121 comments_group.add_argument(
122 "-C", "--comments", action="store_const", const=True, dest="comments",
123 help=_(u"enable comments (default: comments not enabled except if they "
124 u"already exist)")
125 )
126 comments_group.add_argument(
127 "--no-comments", action="store_const", const=False, dest="comments",
128 help=_(u"disable comments (will remove comments node if it exist)")
129 )
130
122 self.parser.add_argument( 131 self.parser.add_argument(
123 "-S", 132 "-S",
124 "--syntax", 133 "--syntax",
125 type=base.unicode_decoder, 134 type=base.unicode_decoder,
126 help=_(u"syntax to use (default: get profile's default syntax)"), 135 help=_(u"syntax to use (default: get profile's default syntax)"),