From f09e2b69e76883c59004dc4937dce12d127335e5 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 02:14:54 -0500 Subject: add todo command --- lib/App/Hiveminder/Command/Todo.pm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Todo.pm diff --git a/lib/App/Hiveminder/Command/Todo.pm b/lib/App/Hiveminder/Command/Todo.pm new file mode 100644 index 0000000..56780b4 --- /dev/null +++ b/lib/App/Hiveminder/Command/Todo.pm @@ -0,0 +1,27 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Todo; +use Moose; +use App::Hiveminder::Utils qw/parse_args display_tasks/; +extends 'App::Hiveminder::Command'; + +=head2 NAME + +App::Hiveminder::Command::Todo - Display the current todo list + +=cut + +sub command { + my ($self, $args) = @_; + my %args = %{ parse_args @$args }; + $args{complete_not} = 0 if exists $args{complete} && + $args{complete} == 1 && + !exists $args{complete_not}; + $args{accepted_not} = 0 if exists $args{accepted} && + $args{accepted} == 1 && + !exists $args{accepted_not}; + $args{owner} = '' if exists $args{owner_not} && $args{owner_not} ne ''; + # XXX: fix for 'starts_before' and 'depends_on_count' + return display_tasks($self->hm, $self->hm->todo_tasks(%args)); +} + +1; -- cgit v1.2.3-54-g00ecf