From 722cc27b216b20a0071d445a414d72d88aed040a Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 29 Mar 2011 13:52:25 -0500 Subject: Add options --status and --severity to `be new` --- libbe/command/new.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libbe/command/new.py') diff --git a/libbe/command/new.py b/libbe/command/new.py index 7dfbed8..7a5c51d 100644 --- a/libbe/command/new.py +++ b/libbe/command/new.py @@ -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 -- cgit From be713557650c789b31a7d9a7525ea5a4e37f26d8 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 29 Mar 2011 13:52:52 -0500 Subject: Add support for 'none' and '-' with --assigned like in `be assign` --- libbe/command/new.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libbe/command/new.py') diff --git a/libbe/command/new.py b/libbe/command/new.py index 7a5c51d..849eafb 100644 --- a/libbe/command/new.py +++ b/libbe/command/new.py @@ -109,7 +109,12 @@ class New (libbe.command.Command): else: bug.reporter = bug.creator if params['assigned'] != None: - bug.assigned = params['assigned'] + assigned = params['assigned'] + if assigned == 'none': + assigned = None + elif assigned == '-': + assigned = self._get_user_id() + bug.assigned = assigned if params['status'] != None: bug.status = params['status'] if params['severity'] != None: -- cgit