X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FApp%2FPromulger%2FCommand%2Fnewlist.pm;h=3ca908c51e33ea9446ea87486889f0420a21722a;hb=f5baca2942c4be01fa044148d361268b505d6754;hp=aa4393a063523c3c560d3b89a5fb1dfe1a88c73f;hpb=514dce6357ac49f714778c90d2fb49ac03eae174;p=p5sagit%2FPromulger.git diff --git a/lib/App/Promulger/Command/newlist.pm b/lib/App/Promulger/Command/newlist.pm index aa4393a..3ca908c 100644 --- a/lib/App/Promulger/Command/newlist.pm +++ b/lib/App/Promulger/Command/newlist.pm @@ -3,9 +3,7 @@ use strict; use warnings; use App::Promulger -command; -use Promulger::Schema; use Promulger::List; - use Config::General; sub abstract { @@ -33,17 +31,17 @@ sub validate_args { } $self->{config} = { Config::General->new($cf)->getall }; - @$args == 1 or die "pmg newlist needs a list name\n"; + $self->{config}{config_file} = $cf; } + sub run { my ($self, $opt, $args) = @_; - Promulger::Schema->connect($self->{config}{store}); + @$args == 1 or die "pmg newlist needs a list name\n"; my $list = Promulger::List->new( listname => $args->[0], ); - $list->setup_aliases_at($self->{config}); - Promulger::Schema->store($list); + $list->setup($self->{config}); } 1;