# HG changeset patch # User Goffi # Date 1550944825 -3600 # Node ID 51c53fc4fc4ac08b6ef2478a1341f618c889a9ac # Parent 0b7ce5daee9bb1f486c985dd487f494d93e6352b 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. diff -r 0b7ce5daee9b -r 51c53fc4fc4a sat_frontends/jp/cmd_blog.py --- a/sat_frontends/jp/cmd_blog.py Sat Feb 23 18:59:00 2019 +0100 +++ b/sat_frontends/jp/cmd_blog.py Sat Feb 23 19:00:25 2019 +0100 @@ -116,9 +116,18 @@ action="append", help=_(u"tag (category) of your item"), ) - self.parser.add_argument( - "-C", "--comments", action="store_true", help=_(u"enable comments") + + comments_group = self.parser.add_mutually_exclusive_group() + comments_group.add_argument( + "-C", "--comments", action="store_const", const=True, dest="comments", + help=_(u"enable comments (default: comments not enabled except if they " + u"already exist)") ) + comments_group.add_argument( + "--no-comments", action="store_const", const=False, dest="comments", + help=_(u"disable comments (will remove comments node if it exist)") + ) + self.parser.add_argument( "-S", "--syntax",