File Coverage

File:blib/lib/Prophet/CLI/Command/Delete.pm
Coverage:84.6%

linestmtbrancondsubpodtimecode
1package Prophet::CLI::Command::Delete;
2
5
5
5
54
27
125
use Any::Moose;
3extends 'Prophet::CLI::Command';
4with 'Prophet::CLI::RecordCommand';
5
6sub usage_msg {
7
4
0
25
    my $self = shift;
8
4
30
    my ($cmd, $type_and_subcmd) = $self->get_cmd_and_subcmd_names;
9
10
4
11
    return <<"END_USAGE";
11usage: ${cmd}${type_and_subcmd} <id>
12END_USAGE
13}
14
15sub run {
16
11
0
39
    my $self = shift;
17
18
11
55
    $self->print_usage if $self->has_arg('h');
19
20
7
217
    $self->require_uuid;
21
7
83
    my $record = $self->_load_record;
22
23
7
77
    if ( $record->delete ) {
24
7
185
        print $record->type . " " . $record->uuid . " deleted.\n";
25    } else {
26
0
        print $record->type . " " . $record->uuid . "could not be deleted.\n";
27    }
28
29}
30
31__PACKAGE__->meta->make_immutable;
32
5
5
5
83
20
39
no Any::Moose;
33
341;
35