From 616f255619183f3ae987c2c98b0413177ae1ec8b Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Fri, 9 May 2008 03:51:59 -0500 Subject: add describe --- lib/App/Hiveminder/Command/Describe.pm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/App/Hiveminder/Command/Describe.pm 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; -- cgit v1.2.3-54-g00ecf