From: W. Trevor King Date: Tue, 14 Jul 2009 21:09:32 +0000 (-0400) Subject: Added --author and --alt-id to "be comment". X-Git-Tag: 1.0.0~62^2~46^2~79 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f98f688c326e8254a02b261ae9b21c1b95539c3a;p=be.git Added --author and --alt-id to "be comment". You could already add this info via the --xml input, now you can do it from the command line too. --- diff --git a/becommands/comment.py b/becommands/comment.py index 66f8da1..6db7895 100644 --- a/becommands/comment.py +++ b/becommands/comment.py @@ -113,6 +113,10 @@ def execute(args, test=False): if options.XML == False: new = parent.new_reply(body=body) + if options.author != None: + new.From = options.author + if options.alt_id != None: + new.alt_id = options.alt_id if options.content_type != None: new.content_type = options.content_type else: # import XML comment [list] @@ -157,6 +161,10 @@ def execute(args, test=False): def get_parser(): parser = cmdutil.CmdOptionParser("be comment ID [COMMENT]") + parser.add_option("-a", "--author", metavar="AUTHOR", dest="author", + help="Set the comment author", default=None) + parser.add_option("--alt-id", metavar="ID", dest="alt_id", + help="Set an alternate comment ID", default=None) parser.add_option("-c", "--content-type", metavar="MIME", dest="content_type", help="Set comment content-type (e.g. text/plain)", default=None) parser.add_option("-x", "--xml", action="store_true", default=False,