standardize on strictures+autodie+Test::Most where applicable
[p5sagit/Promulger.git] / lib / App / Promulger / Command / rmlist.pm
CommitLineData
9bfd7b60 1package App::Promulger::Command::rmlist;
2a007b5a 2use strictures 1;
3use autodie;
9bfd7b60 4
5use App::Promulger -command;
6use Promulger::List;
7
8sub abstract {
9 return "removes a list";
10}
11
12sub run {
13 my ($self, $opt, $args) = @_;
14 @$args == 1 or die "pmg rmlist needs a list name\n";
15
16 my $listname = $args->[0];
17 my $list = Promulger::List->resolve($listname);
18
19 if($list) {
20 $list->delete;
21 } else {
22 die "$listname doesn't exist\n";
23 }
24}
25
26'Make it so';
27