From: Andrew Chilton Date: Mon, 30 Nov 2009 09:33:37 +0000 (+1300) Subject: Slight changes to a few commands X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=87dc0c170e979afba06ba1828f9713954549b8d4;p=cil.git Slight changes to a few commands --- diff --git a/bin/cil b/bin/cil index 6975256..0205e27 100755 --- 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 diff --git a/lib/CIL/Command/Label.pm b/lib/CIL/Command/Label.pm index e239491..8ddd330 100644 --- a/lib/CIL/Command/Label.pm +++ b/lib/CIL/Command/Label.pm @@ -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; diff --git a/lib/CIL/Command/Status.pm b/lib/CIL/Command/Status.pm index 945c22a..529ca7b 100644 --- a/lib/CIL/Command/Status.pm +++ b/lib/CIL/Command/Status.pm @@ -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; diff --git a/lib/CIL/Command/Work.pm b/lib/CIL/Command/Work.pm index 7ffc6dd..3a71c99 100644 --- a/lib/CIL/Command/Work.pm +++ b/lib/CIL/Command/Work.pm @@ -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;