From 0d92f6e35358125bac8e5c205da0bd6ae6af1976 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 04:07:25 -0500 Subject: add comment --- lib/App/Hiveminder/Command/Comment.pm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Comment.pm diff --git a/lib/App/Hiveminder/Command/Comment.pm b/lib/App/Hiveminder/Command/Comment.pm new file mode 100644 index 0000000..63973f9 --- /dev/null +++ b/lib/App/Hiveminder/Command/Comment.pm @@ -0,0 +1,29 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Comment; +use Moose; +use App::Hiveminder::Utils qw/get_text_from_editor_or_cmdline display_tasks/; +extends 'App::Hiveminder::Command'; + +=head2 NAME + +App::Hiveminder::Command::Comment - Add a comment to a task + +=cut + +sub command_names { qw/comment add-comment add_comment comment-on comment_on/ } + +sub command { + my $self = shift; + + return unless @_ > 0; + my $locator = shift; + $self->hm->comment_on($self->hm->read_task($locator), + get_text_from_editor_or_cmdline(@_)); + my $task = $self->hm->read_task($locator); + my $display = display_tasks($self->hm, $task); + return "Comments for: $display\n" . + (join "\n", $self->hm->comments_on($task)); +} + +__PACKAGE__->meta()->make_immutable(); +1; -- cgit v1.2.3