]> git.mjollnir.org Git - cil.git/commitdiff
Add the --mine option to the 'Add' command (so it automatically assigns to you)
authorAndrew Chilton <andychilton@gmail.com>
Mon, 6 Oct 2008 01:40:57 +0000 (14:40 +1300)
committerAndrew Chilton <andychilton@gmail.com>
Mon, 6 Oct 2008 01:40:57 +0000 (14:40 +1300)
bin/cil
lib/CIL/Command/Add.pm

diff --git a/bin/cil b/bin/cil
index dff5789fb0cb8356064da52d70a9690d9f3926f4..3ffc8d15e5a66708078fbff2063c6fbadcffdfb4 100755 (executable)
--- 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,
 );
 
 ## ----------------------------------------------------------------------------
index c0a2d1596337eb6ff4c3cf3093187ed8f59ead3b..de8a9e2a67bd6149afe2994a73ad09db5b025b2e 100644 (file)
@@ -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);