Added --author and --alt-id to "be comment".
authorW. Trevor King <wking@drexel.edu>
Tue, 14 Jul 2009 21:09:32 +0000 (17:09 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 14 Jul 2009 21:09:32 +0000 (17:09 -0400)
You could already add this info via the --xml input, now you can do it
from the command line too.

becommands/comment.py

index 66f8da17e52c56eaf241eec5330545f588cc8676..6db78959138f7ff013fc2d0d4f63c696ccb8de0a 100644 (file)
@@ -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,