summaryrefslogtreecommitdiffstats
path: root/lib/App/Hiveminder/Command/Comments.pm
blob: 3cfe9b44b45fdfec92529a10fd7e1bb12252ecbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/perl
package App::Hiveminder::Command::Comments;
use Moose;
use App::Hiveminder::Utils qw/parse_args display_tasks/;
extends 'App::Hiveminder::Command';

=head2 NAME

App::Hiveminder::Command::Comments - Display the comments on tasks

=cut

sub command_names { qw/comments get-comments get_comments/ }

sub command {
    my $self = shift;

    return unless @_ > 0;
    my $ret;
    my @tasks = $self->hm->get_tasks(%{ parse_args @_ });
    for my $task (@tasks) {
        my $desc = display_tasks($self->hm, $task);
        $ret .= "Comments for: $desc\n";
        $ret .= join "\n", ($self->hm->comments_on($task));
    }
    return $ret;
}

__PACKAGE__->meta()->make_immutable();
1;