diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-05-09 02:53:28 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-05-09 02:53:28 -0500 |
commit | 27d9f3590bab32b43d5565666a4ce245a1a3b6e7 (patch) | |
tree | 21415f11e065a09a7b0cc08063d5ba867058f8fa | |
parent | 48d6387bfee7c82e3f30dfe1760f48d55cce1f52 (diff) | |
download | app-hiveminder-27d9f3590bab32b43d5565666a4ce245a1a3b6e7.tar.gz app-hiveminder-27d9f3590bab32b43d5565666a4ce245a1a3b6e7.zip |
add a priority command
-rw-r--r-- | lib/App/Hiveminder/Command/Priority.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/App/Hiveminder/Command/Priority.pm b/lib/App/Hiveminder/Command/Priority.pm new file mode 100644 index 0000000..f030f6e --- /dev/null +++ b/lib/App/Hiveminder/Command/Priority.pm @@ -0,0 +1,27 @@ +#!/usr/bin/perl +package App::Hiveminder::Command::Priority; +use Moose; +use App::Hiveminder::Utils qw/parse_args display_tasks + update_tasks/; +extends 'App::Hiveminder::Command'; + +=head2 NAME + +App::Hiveminder::Command::Priority - Set the priority of tasks + +=cut + +sub command_names { qw/priority pri/ } + +sub command { + my $self = shift; + + return unless @_ > 1; + my $priority = pop; + return display_tasks($self->hm, + @{ update_tasks($self->hm, parse_args(@_), + sub { (priority => $priority) }) }); +} + +__PACKAGE__->meta()->make_immutable(); +1; |