summaryrefslogtreecommitdiffstats
path: root/lib/App/Hiveminder/Command/Braindump.pm
blob: 92786f36be39a4c2eca2a26a8a0c72d0d2d1cd70 (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
#!/usr/bin/perl
package App::Hiveminder::Command::Braindump;
use Moose;
use App::Hiveminder::Utils qw/get_text_from_editor display_tasks/;
extends 'App::Hiveminder::Command';

=head2 NAME

App::Hiveminder::Command::Braindump - Create several tasks at once

=cut

sub command_names { qw/braindump bd/ }

sub command {
    my ($self, $args) = @_;

    my $text = get_text_from_editor;
    return display_tasks($self->hm->braindump($text, returns => 'tasks',
                                                     tokens  => [@$args]))
        unless $text eq '';
    return '';
}

1;