From 2e0f36661aaa0804a035fa338880f0e0d687f47d Mon Sep 17 00:00:00 2001 From: Andrew Chilton Date: Mon, 6 Oct 2008 14:40:57 +1300 Subject: [PATCH] Add the --mine option to the 'Add' command (so it automatically assigns to you) --- bin/cil | 2 ++ lib/CIL/Command/Add.pm | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/cil b/bin/cil index dff5789..3ffc8d1 100755 --- a/bin/cil +++ b/bin/cil @@ -58,6 +58,7 @@ my @IN_OPTS = ( 'is-open', # for 'summary', 'list' 'is-closed', # for 'summary', 'list' 'is-mine', # for 'summary', 'list' + 'mine', # for 'add' 'help', 'version', ); @@ -69,6 +70,7 @@ my %BOOLEAN_ARGS = ( 'is-open' => 1, 'is-closed' => 1, 'is-mine' => 1, + 'mine' => 1, ); ## ---------------------------------------------------------------------------- diff --git a/lib/CIL/Command/Add.pm b/lib/CIL/Command/Add.pm index c0a2d15..de8a9e2 100644 --- a/lib/CIL/Command/Add.pm +++ b/lib/CIL/Command/Add.pm @@ -31,7 +31,7 @@ use base qw(CIL::Command); sub name { 'add' } sub run { - my ($self, $cil, undef, @argv) = @_; + my ($self, $cil, $args, @argv) = @_; CIL::Utils->ensure_interactive(); @@ -41,6 +41,8 @@ sub run { $issue->Summary( join ' ', @argv ); $issue->Status('New'); $issue->CreatedBy( $user ); + $issue->AssignedTo( $user ) + if $args->{mine}; $issue->Description("Description ..."); CIL::Utils->add_issue_loop($cil, undef, $issue); -- 2.39.5