Add options --status and --severity to `be new`
authorAndrew Cooper <andrew.cooper@hkcreations.org>
Tue, 29 Mar 2011 18:52:25 +0000 (13:52 -0500)
committerAndrew Cooper <andrew.cooper@hkcreations.org>
Tue, 29 Mar 2011 18:52:25 +0000 (13:52 -0500)
libbe/command/new.py

index 7dfbed8f11ece9996ee57b8dc11207f0a4010887..7a5c51d9f6b0de08097d0bcad56a6094f7a41d64 100644 (file)
@@ -78,6 +78,16 @@ class New (libbe.command.Command):
                     arg=libbe.command.Argument(
                         name='assigned', metavar='NAME',
                         completion_callback=libbe.command.util.complete_assigned)),
+                libbe.command.Option(name='status', short_name='t',
+                    help='The bug\'s status level',
+                    arg=libbe.command.Argument(
+                        name='status', metavar='STATUS',
+                        completion_callback=libbe.command.util.complete_status)),
+                libbe.command.Option(name='severity', short_name='s',
+                    help='The bug\'s severity',
+                    arg=libbe.command.Argument(
+                        name='severity', metavar='SEVERITY',
+                        completion_callback=libbe.command.util.complete_severity)),
                 ])
         self.args.extend([
                 libbe.command.Argument(name='summary', metavar='SUMMARY')
@@ -100,6 +110,10 @@ class New (libbe.command.Command):
             bug.reporter = bug.creator
         if params['assigned'] != None:
             bug.assigned = params['assigned']
+        if params['status'] != None:
+            bug.status = params['status']
+        if params['severity'] != None:
+            bug.severity = params['severity']
         print >> self.stdout, 'Created bug with ID %s' % bug.id.user()
         return 0