Commit | Line | Data |
9bfd7b60 |
1 | package App::Promulger::Command::rmlist; |
2a007b5a |
2 | use strictures 1; |
3 | use autodie; |
9bfd7b60 |
4 | |
5 | use App::Promulger -command; |
6 | use Promulger::List; |
7 | |
8 | sub abstract { |
9 | return "removes a list"; |
10 | } |
11 | |
12 | sub 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 | |