From 9262cd80d77bdd792f59f61dfdd9ddf9d65f9d5a Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 02:41:19 -0500 Subject: add 'done' command --- lib/App/Hiveminder/Command/Done.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Done.pm 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; -- cgit v1.2.3-54-g00ecf