From 45e086dd6bb30619090bb1e248f1c2f5f5e77886 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 02:47:23 -0500 Subject: add a tag command --- lib/App/Hiveminder/Command/Tag.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Tag.pm diff --git a/lib/App/Hiveminder/Command/Tag.pm b/lib/App/Hiveminder/Command/Tag.pm new file mode 100644 index 0000000..23e5eca --- /dev/null +++ b/lib/App/Hiveminder/Command/Tag.pm @@ -0,0 +1,25 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Tag; +use Moose; +use App::Hiveminder::Utils qw/update_tasks parse_args display_tasks/; +extends 'App::Hiveminder::Command'; + +=head2 NAME + +App::Hiveminder::Command::Tag - Add a tag to tasks + +=cut + +sub command_names { qw/tag/ } + +sub command { + my $self = shift; + + return unless @_ > 1; + my $tag = pop; + return display_tasks($self->hm, + @{ update_tasks($self->hm, parse_args(@_), + sub { (tags => shift->{tags} . " \"$tag\"") }) }); +} + +1; -- cgit v1.2.3