From 9a5ca6c33099d8f225324268558a494adc9b8127 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 02:55:32 -0500 Subject: add a due command --- lib/App/Hiveminder/Command/Due.pm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Due.pm 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; -- cgit v1.2.3