summaryrefslogtreecommitdiffstats
path: root/lib/App/Hiveminder/Command/Accept.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/Hiveminder/Command/Accept.pm')
-rw-r--r--lib/App/Hiveminder/Command/Accept.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/App/Hiveminder/Command/Accept.pm b/lib/App/Hiveminder/Command/Accept.pm
new file mode 100644
index 0000000..210dec5
--- /dev/null
+++ b/lib/App/Hiveminder/Command/Accept.pm
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+package App::Hiveminder::Command::Accept;
+use Moose;
+use App::Hiveminder::Utils qw/parse_args display_tasks update_tasks/;
+extends 'App::Hiveminder::Command';
+
+=head2 NAME
+
+App::Hiveminder::Command::Accept - Accept open tasks
+
+=cut
+
+sub command_names { qw/accept take/ }
+
+sub command {
+ my $self = shift;
+
+ return unless @_ > 0;
+ return display_tasks($self->hm,
+ @{ update_tasks($self->hm, parse_args(@_),
+ sub { (accepted => 1) }) });
+}
+
+__PACKAGE__->meta()->make_immutable();
+1;