diff options
-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; |