diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-05-09 02:41:19 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-05-09 02:41:19 -0500 |
commit | 9262cd80d77bdd792f59f61dfdd9ddf9d65f9d5a (patch) | |
tree | 0ff4d80d2775e6b4b4eb4835ebcfa322c32e6b99 | |
parent | d6f54d5c7f5b3a06aad9eeddbfd2b6585035d485 (diff) | |
download | app-hiveminder-9262cd80d77bdd792f59f61dfdd9ddf9d65f9d5a.tar.gz app-hiveminder-9262cd80d77bdd792f59f61dfdd9ddf9d65f9d5a.zip |
add 'done' command
-rw-r--r-- | lib/App/Hiveminder/Command/Done.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/App/Hiveminder/Command/Done.pm b/lib/App/Hiveminder/Command/Done.pm new file mode 100644 index 0000000..becd391 --- /dev/null +++ b/lib/App/Hiveminder/Command/Done.pm @@ -0,0 +1,25 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Done; +use Moose; +use App::Hiveminder::Utils qw/parse_args display_tasks/; +extends 'App::Hiveminder::Command'; + +=head2 NAME + +App::Hiveminder::Command::Done - Mark tasks as being completed + +=cut + +sub command_names { qw/done complete d do/ } + +sub command { + my $self = shift; + + return unless @_ > 0; + my @tasks = $self->hm->get_tasks(%{ parse_args @_ }); + $self->hm->done(@tasks); + map { $_->{complete} = 1 } @tasks; + return display_tasks($self->hm, @tasks); +} + +1; |