1 package Email::EzPz::ListCore;
5 use IPC::System::Simple qw(run capture);
7 has list_dir => (is => 'ro', required => 1);
9 has ezmlm_bindir => (is => 'ro', required => 1);
11 requires 'sublist_type';
14 my ($self, $command) = @_;
15 if (ref(my $bindir = $self->ezmlm_bindir) eq 'ARRAY') { # prefix list
16 return (@{$bindir}, "ezmlm-${command}");
18 return io->dir($bindir)->catfile("ezmlm-${command}");
23 my ($self, $command, @args) = @_;
25 $self->_command_path($command),
33 my ($self, @cmd) = @_;
34 run $self->_command_args(@cmd);
37 sub _capture_command {
38 my ($self, @cmd) = @_;
39 map { chomp; $_ } capture $self->_command_args(@cmd);
43 my ($self, $member) = @_;
44 $self->_call_command(sub => $member);
49 my ($self, $member) = @_;
50 $self->_call_command(unsub => $member);
56 $self->_capture_command('list');