MDK Tracker commenting
[mdk.git] / mdk / commands / tracker.py
index 6ed449a..3ba7f1b 100644 (file)
@@ -27,7 +27,7 @@ import textwrap
 import re
 from ..command import Command
 from ..jira import Jira
-from ..tools import parseBranch
+from ..tools import parseBranch, getText
 
 
 class TrackerCommand(Command):
@@ -66,6 +66,13 @@ class TrackerCommand(Command):
                 'metavar':  'labels',
                 'nargs': '+',
             }
+        ),
+        (
+            ['--comment'],
+            {
+                'action': 'store_true',
+                'help': 'add a comment to the issue',
+            }
         )
     ]
     _description = 'Interact with Moodle tracker'
@@ -105,6 +112,10 @@ class TrackerCommand(Command):
                 self.argumentError('The label \'triaging_in_progress\' cannot be removed using MDK')
             self.Jira.removeLabels(self.mdl, args.removelabels)
 
+        if args.comment:
+            comment = getText()
+            self.Jira.addComment(self.mdl, comment)
+
         self.info(args)
 
     def info(self, args):