summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-05-09 03:51:59 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-05-09 03:51:59 -0500
commit616f255619183f3ae987c2c98b0413177ae1ec8b (patch)
treef24784a554144705061c59d136ea291f7836b4d3
parent5a41be4244db0a966d9c7342481d6c067e21d4d2 (diff)
downloadapp-hiveminder-616f255619183f3ae987c2c98b0413177ae1ec8b.tar.gz
app-hiveminder-616f255619183f3ae987c2c98b0413177ae1ec8b.zip
add describe
-rw-r--r--lib/App/Hiveminder/Command/Describe.pm30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/App/Hiveminder/Command/Describe.pm b/lib/App/Hiveminder/Command/Describe.pm
new file mode 100644
index 0000000..4f5a63e
--- /dev/null
+++ b/lib/App/Hiveminder/Command/Describe.pm
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+package App::Hiveminder::Command::Describe;
+use Moose;
+use App::Hiveminder::Utils qw/get_text_from_editor_or_cmdline update_tasks
+ display_tasks/;
+extends 'App::Hiveminder::Command';
+
+=head2 NAME
+
+App::Hiveminder::Command::Describe - Add a description to a task
+
+=cut
+
+sub command_names { qw/describe add-description add_description/ }
+
+sub command {
+ my $self = shift;
+
+ return unless @_ > 1;
+ my $task = $self->hm->read_task(shift);
+ my $description = get_text_from_editor_or_cmdline(@_);
+ chomp $description;
+ $task = update_tasks($self->hm, [$hm->id2loc($task->{id})],
+ sub { (description => $description) })->[0];
+ my $display = display_tasks($self->hm, $task);
+ return "Description for $display:\n$task->{description}\n";
+}
+
+__PACKAGE__->meta()->make_immutable();
+1;