1 package App::Promulger::Command::newlist;
5 use App::Promulger -command;
10 return "creates a new list";
15 [ "config|c=s", "configuration file", { required => 1 } ],
20 my ($self, $opt, $args) = @_;
21 my $cf = $opt->{config};
24 die "Config file $cf doesn't exist\n";
27 die "Config file $cf not a file\n";
30 die "Config file $cf not readable\n";
33 $self->{config} = { Config::General->new($cf)->getall };
34 $self->{config}{config_file} = $cf;
39 my ($self, $opt, $args) = @_;
40 @$args == 1 or die "pmg newlist needs a list name\n";
41 my $list = Promulger::List->new(
42 listname => $args->[0],
44 $list->setup($self->{config});