]> git.mjollnir.org Git - cil.git/commitdiff
Closes issue fb79b2e8.
authorAndrew Chilton <andychilton@gmail.com>
Sun, 22 Jun 2008 04:04:51 +0000 (16:04 +1200)
committerAndrew Chilton <andychilton@gmail.com>
Sun, 22 Jun 2008 04:04:51 +0000 (16:04 +1200)
bin/cil
issues/c_792a4acf.cil [new file with mode: 0644]
issues/i_fb79b2e8.cil

diff --git a/bin/cil b/bin/cil
index eed01ca6a9dc95346c3bdb0b966fc6fa1230720d..7e14dec2dd6e3da816b9b77a39233ffee3897f92 100755 (executable)
--- a/bin/cil
+++ b/bin/cil
@@ -45,6 +45,7 @@ my $COMMANDS = {
     summary => 1,
     add     => 1,
     show    => 1,
+    status  => 1,
     edit    => 1,
     comment => 1,
     attach  => 1,
@@ -128,6 +129,11 @@ EOF
         my ($issue_name) = @ARGV;
         show($cil, $issue_name);
 
+    }
+    elsif ( $command eq 'status' ) {
+        my ($issue_name, $status) = @ARGV;
+        status($cil, $issue_name, $status);
+
     }
     elsif ( $command eq 'add' ) {
         add($cil);
@@ -249,6 +255,26 @@ sub show {
     display_issue_full($cil, $issue);
 }
 
+sub status {
+    my ($cil, $issue_name, $status) = @_;
+
+    unless ( defined $status ) {
+        fatal("provide a status to set this issue to");
+    }
+
+    # firstly, read the issue in
+    my $issue = CIL::Issue->new_from_name($cil, $issue_name);
+    unless ( defined $issue ) {
+        fatal("Couldn't load issue '$issue_name'");
+    }
+
+    # set the status for this issue
+    $issue->Status( $status );
+    $issue->save($cil);
+
+    display_issue($cil, $issue);
+}
+
 sub add {
     my ($cil, $issue_name) = @_;
 
@@ -561,6 +587,7 @@ Commands:
    summary
    list
    show    ISSUE
+   status  ISSUE NEW_STATUS
    edit    ISSUE
    comment ISSUE
    attach  ISSUE FILENAME
@@ -587,6 +614,7 @@ cil - the command-line issue list
     ... added issue 'cafebabe' ...
     $ cil show cafebabe
     $ cil edit cafebabe
+    $ cil status cafebabe InProgress
 
     $ cil comment cafebabe
     ... added comment 'deadbeef' ...
@@ -625,6 +653,11 @@ Adds an issues after you have edited the input.
 
 Shows the issue name with more detail.
 
+=item status ISSUE NEW_STATUS
+
+Shortcut so that you can set a new status on an issue without having to edit
+it.
+
 =item edit ISSUE
 
 Edits the issue. If it changes, set the updates time to now.
diff --git a/issues/c_792a4acf.cil b/issues/c_792a4acf.cil
new file mode 100644 (file)
index 0000000..c22f3f4
--- /dev/null
@@ -0,0 +1,6 @@
+Issue: fb79b2e8
+CreatedBy: Andrew Chilton <andychilton@gmail.com>
+Inserted: 2008-06-22T04:02:46
+Updated: 2008-06-22T04:02:46
+
+This has been completed.
index 97fecb7bd27ac9abe278f51f14b64f5b95f4d079..b218517cd36ef43ab2faca5055b3c54f66e275a1 100644 (file)
@@ -1,12 +1,13 @@
 Summary: Ability to set Issue Status' from the command line
-Status: New
+Status: Finished
 CreatedBy: Andrew Chilton <andychilton@gmail.com>
 AssignedTo: Andrew Chilton <andychilton@gmail.com>
 Label: Mileston-v0.2
 Label: Release-v0.1
 Label: Type-Enhancement
+Comment: 792a4acf
 Inserted: 2008-06-22T04:00:20
-Updated: 2008-06-22T04:00:20
+Updated: 2008-06-22T04:02:46
 
 The ability to do something like the following would be good.