summaryrefslogtreecommitdiffstats
path: root/lib/App/Hiveminder/Command/Untag.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/Hiveminder/Command/Untag.pm')
-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;