]> git.mjollnir.org Git - cil.git/commitdiff
Slight changes to a few commands
authorAndrew Chilton <andychilton@gmail.com>
Mon, 30 Nov 2009 09:33:37 +0000 (22:33 +1300)
committerAndrew Chilton <andychilton@gmail.com>
Mon, 30 Nov 2009 09:33:37 +0000 (22:33 +1300)
bin/cil
lib/CIL/Command/Label.pm
lib/CIL/Command/Status.pm
lib/CIL/Command/Work.pm

diff --git a/bin/cil b/bin/cil
index 6975256e78d77dbed784daae34525cdc644617e8..0205e2744694d3580d0a623776b0dfabbfccf1ee 100755 (executable)
--- a/bin/cil
+++ b/bin/cil
@@ -160,7 +160,8 @@ Commands:
    summary [FILTERS...]
    list    [FILTERS...]
    show    ISSUE
-   status  ISSUE NEW_STATUS
+   status  NEW_STATUS [ISSUES...]
+   label   NEW_LABEL [ISSUES...]
    steal   ISSUE
    edit    ISSUE
    comment ISSUE
index e239491c6844b7c02e7efb96b6867178983a8494..8ddd3305be755f92818720764a8a0838bb5c34f9 100644 (file)
@@ -31,20 +31,21 @@ use base qw(CIL::Command);
 sub name { 'label' }
 
 sub run {
-    my ($self, $cil, undef, $issue_name, $label) = @_;
+    my ($self, $cil, undef, $label, @issue_names) = @_;
 
     unless ( defined $label ) {
-        $cil->fatal("provide a label to add to this issue");
+        CIL::Utils->fatal("provide a valid label to add to this issue");
     }
 
-    # firstly, read the issue in
-    my $issue = CIL::Utils->load_issue_fuzzy( $cil, $issue_name );
+    # for every issue, read it it and add the label
+    foreach my $issue_name ( @issue_names ) {
+        # firstly, read the issue in
+        my $issue = CIL::Utils->load_issue_fuzzy( $cil, $issue_name );
 
-    # set the status for this issue
-    $issue->add_label( $label );
-    $issue->save($cil);
-
-    CIL::Utils->display_issue($cil, $issue);
+        # set the status for this issue
+        $issue->add_label( $label );
+        $issue->save($cil);
+    }
 }
 
 1;
index 945c22a9660936b1b8307c64180689caaed6e454..529ca7bb42a128810a100ba2ad03d9655b3d246e 100644 (file)
@@ -31,20 +31,21 @@ use base qw(CIL::Command);
 sub name { 'status' }
 
 sub run {
-    my ($self, $cil, undef, $issue_name, $status) = @_;
+    my ($self, $cil, undef, $status, @issue_names) = @_;
 
     unless ( defined $status ) {
-        CIL::Utils->fatal("provide a status to set this issue to");
+        CIL::Utils->fatal("provide a valid status to set this issue to");
     }
 
-    # firstly, read the issue in
-    my $issue = CIL::Utils->load_issue_fuzzy( $cil, $issue_name );
+    # for every issue, read it it and set the Status
+    foreach my $issue_name ( @issue_names ) {
+        # firstly, read the issue in
+        my $issue = CIL::Utils->load_issue_fuzzy( $cil, $issue_name );
 
-    # set the status for this issue
-    $issue->Status( $status );
-    $issue->save($cil);
-
-    CIL::Utils->display_issue($cil, $issue);
+        # set the label for this issue
+        $issue->Status( $status );
+        $issue->save($cil);
+    }
 }
 
 1;
index 7ffc6dd20268c6274b2f0495990a14f381733374..3a71c994e8a5be9a955f14bbd202ff3a4aa734cd 100644 (file)
@@ -50,6 +50,11 @@ sub run {
     else {
         $cil->vcs->create_branch( $issue->name );
     }
+
+    # now that we've switched branches, load the issue in again (just in case)
+    $issue = CIL::Utils->load_issue_fuzzy( $cil, $issue_name );
+    $issue->Status( 'InProgress' );
+    $issue->save($cil);
 }
 
 1;