summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-05-09 02:49:32 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-05-09 02:49:32 -0500
commitebb535fa0b28e79b1ad55cff88b337b052554392 (patch)
treee46251b8a2652148b57d684a76b4784c1915882e /lib
parent45e086dd6bb30619090bb1e248f1c2f5f5e77886 (diff)
downloadapp-hiveminder-ebb535fa0b28e79b1ad55cff88b337b052554392.tar.gz
app-hiveminder-ebb535fa0b28e79b1ad55cff88b337b052554392.zip
add an untag command
Diffstat (limited to 'lib')
-rw-r--r--lib/App/Hiveminder/Command/Untag.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/App/Hiveminder/Command/Untag.pm b/lib/App/Hiveminder/Command/Untag.pm
new file mode 100644
index 0000000..4219895
--- /dev/null
+++ b/lib/App/Hiveminder/Command/Untag.pm
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+package App::Hiveminder::Command::Untag;
+use Moose;
+use App::Hiveminder::Utils qw/update_tasks parse_args display_tasks/;
+extends 'App::Hiveminder::Command';
+
+=head2 NAME
+
+App::Hiveminder::Command::Untag - Remove a tag from tasks
+
+=cut
+
+sub command_names { qw/untag/ }
+
+sub command {
+ my $self = shift;
+
+ return unless @_ > 1;
+ my $tag = pop;
+ return display_tasks($self->hm,
+ @{ update_tasks($self->hm, parse_args(@_),
+ sub { my $tags = shift->{tags};
+ $tags =~ s/\Q\"$tag\"//;
+ (tags => $tags) }) });
+}
+
+1;