From aa7731c44b8e5d554764b8e41c7d52556d238bb2 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 02:44:12 -0500 Subject: add an undone command --- lib/App/Hiveminder/Command/Undone.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Undone.pm diff --git a/lib/App/Hiveminder/Command/Undone.pm b/lib/App/Hiveminder/Command/Undone.pm new file mode 100644 index 0000000..e6ccf6c --- /dev/null +++ b/lib/App/Hiveminder/Command/Undone.pm @@ -0,0 +1,24 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Undone; +use Moose; +use App::Hiveminder::Utils qw/parse_args display_tasks update_tasks/; +extends 'App::Hiveminder::Command'; + +=head2 NAME + +App::Hiveminder::Command::Undone - Mark tasks as not being completed + +=cut + +sub command_names { qw/undone undo/ } + +sub command { + my $self = shift; + + return unless @_ > 0; + return display_tasks($self->hm, + @{ update_tasks($self->hm, parse_args(@_), + sub { (complete => 0) }) }); +} + +1; -- cgit v1.2.3