diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-05-09 04:07:25 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-05-09 04:07:25 -0500 |
commit | 0d92f6e35358125bac8e5c205da0bd6ae6af1976 (patch) | |
tree | 01f698f918f3586ab9bdb6ef3cff6ab934988853 | |
parent | 77e02c510dce9ae58af5d4c272a20ee816d6b1c5 (diff) | |
download | app-hiveminder-0d92f6e35358125bac8e5c205da0bd6ae6af1976.tar.gz app-hiveminder-0d92f6e35358125bac8e5c205da0bd6ae6af1976.zip |
add comment
-rw-r--r-- | lib/App/Hiveminder/Command/Comment.pm | 29 |
1 files changed, 29 insertions, 0 deletions
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; |