From 8615a4e2a61d793f5faf47f0e10def960493ee42 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Thu, 8 May 2008 22:32:33 -0500 Subject: apparently App::Cmd will lc the package name for us --- lib/App/Hiveminder/Command/Create.pm | 29 +++++++++++++++++++++++++++++ lib/App/Hiveminder/Command/create.pm | 29 ----------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 lib/App/Hiveminder/Command/Create.pm delete mode 100644 lib/App/Hiveminder/Command/create.pm diff --git a/lib/App/Hiveminder/Command/Create.pm b/lib/App/Hiveminder/Command/Create.pm new file mode 100644 index 0000000..6295a52 --- /dev/null +++ b/lib/App/Hiveminder/Command/Create.pm @@ -0,0 +1,29 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Create; +use Moose; +use App::Hiveminder::Utils qw/get_text_from_editor_or_cmdline display_tasks + update_tasks/; +extends 'App::Hiveminder::Command'; + +sub command { + my ($self, $args) = @_; + $args = join " ", @$args; + + my $text = get_text_from_editor_or_cmdline($args); + return '' if $text eq ''; + my @text = split "\n", $text; + + my $task = $self->hm->create_task(shift @text); + my $ret = display_tasks($self->hm, $task); + + if (@text > 0) { + $ret = display_tasks($self->hm, + @{ update_tasks($self->hm, [$self->hm->id2loc($task->{id})], + sub { (description => (join "\n", @text)) }) }); + } + + return $ret; +} + +__PACKAGE__->meta()->make_immutable(); +1; diff --git a/lib/App/Hiveminder/Command/create.pm b/lib/App/Hiveminder/Command/create.pm deleted file mode 100644 index e99fb24..0000000 --- a/lib/App/Hiveminder/Command/create.pm +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/perl -package App::Hiveminder::Command::create; -use Moose; -use App::Hiveminder::Utils qw/get_text_from_editor_or_cmdline display_tasks - update_tasks/; -extends 'App::Hiveminder::Command'; - -sub command { - my ($self, $args) = @_; - $args = join " ", @$args; - - my $text = get_text_from_editor_or_cmdline($args); - return '' if $text eq ''; - my @text = split "\n", $text; - - my $task = $self->hm->create_task(shift @text); - my $ret = display_tasks($self->hm, $task); - - if (@text > 0) { - $ret = display_tasks($self->hm, - @{ update_tasks($self->hm, [$self->hm->id2loc($task->{id})], - sub { (description => (join "\n", @text)) }) }); - } - - return $ret; -} - -__PACKAGE__->meta()->make_immutable(); -1; -- cgit v1.2.3