File Coverage

blib/lib/App/LDAP/Command/Del/Group.pm
Criterion Covered Total %
statement 4 6 66.6
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 6 8 75.0


line stmt bran cond sub pod time code
1             package App::LDAP::Command::Del::Group;
2              
3 1     1   6 use Modern::Perl;
  1         1  
  1         6  
4              
5 1     1   553 use Moose;
  0            
  0            
6              
7             with qw( App::LDAP::Role::Command
8             App::LDAP::Role::Bindable );
9              
10             use App::LDAP::LDIF::Group;
11              
12             sub run {
13             my ($self) = shift;
14              
15             my $groupname = $self->extra_argv->[2] or die "no group name specified";
16              
17             my $group = App::LDAP::LDIF::Group->search(
18             base => config()->{nss_base_group}->[0],
19             scope => config()->{nss_base_group}->[1],
20             filter => "cn=$groupname",
21             );
22              
23             $group->delete;
24             }
25              
26             __PACKAGE__->meta->make_immutable;
27             no Moose;
28              
29             1;