From 27a449d8cf5a20025a978a95453aed19d25302cf Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 03:44:38 -0500 Subject: add give --- lib/App/Hiveminder/Command/Give.pm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Give.pm diff --git a/lib/App/Hiveminder/Command/Give.pm b/lib/App/Hiveminder/Command/Give.pm new file mode 100644 index 0000000..52810a1 --- /dev/null +++ b/lib/App/Hiveminder/Command/Give.pm @@ -0,0 +1,26 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Give; +use Moose; +use App::Hiveminder::Utils qw/parse_args display_tasks update_tasks/; +extends 'App::Hiveminder::Command'; + +=head2 NAME + +App::Hiveminder::Command::Give - Offer tasks to other people + +=cut + +sub command_names { qw/give offer/ } + +sub command { + my $self = shift; + + return unless @_ > 1; + my $email = pop; + return display_tasks($self->hm, + @{ update_tasks($self->hm, parse_args(@_), + sub { (owner_id => $email) }) }); +} + +__PACKAGE__->meta()->make_immutable(); +1; -- cgit v1.2.3-54-g00ecf