summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-05-09 02:55:32 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-05-09 02:55:32 -0500
commit9a5ca6c33099d8f225324268558a494adc9b8127 (patch)
tree33db5525c4284e88736e232d521534bfaf6e2eca
parent27d9f3590bab32b43d5565666a4ce245a1a3b6e7 (diff)
downloadapp-hiveminder-9a5ca6c33099d8f225324268558a494adc9b8127.tar.gz
app-hiveminder-9a5ca6c33099d8f225324268558a494adc9b8127.zip
add a due command
-rw-r--r--lib/App/Hiveminder/Command/Due.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/App/Hiveminder/Command/Due.pm b/lib/App/Hiveminder/Command/Due.pm
new file mode 100644
index 0000000..a7f9d44
--- /dev/null
+++ b/lib/App/Hiveminder/Command/Due.pm
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+package App::Hiveminder::Command::Due;
+use Moose;
+use App::Hiveminder::Utils qw/parse_args display_tasks update_tasks/;
+extends 'App::Hiveminder::Command';
+
+=head2 NAME
+
+App::Hiveminder::Command::Due - Set the due date for tasks
+
+=cut
+
+sub command_names { qw/due date/ }
+
+sub command {
+ my $self = shift;
+
+ return unless @_ > 1;
+ my $due = pop;
+ return display_tasks($self->hm,
+ @{ update_tasks($self->hm, parse_args(@_),
+ sub { (due => $due) }) });
+}
+
+__PACKAGE__->meta()->make_immutable();
+1;