lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/DisableProtection.pm

filter: Statementstmt 100% 17 / 17 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 88.4% 23 / 26 CC 3 SCAR 7.2
CC
3
Cov
90%
execute
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Delete.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/DisableSnapshotPlan.pm »
1 package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::DisableProtection;
2 # ABSTRACT: Disable Storage Box delete protection
3  
4 1 our $VERSION = '0.102';
5  
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use MooX::Cmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use MooX::Options protect_argv => 0, usage_string => 'USAGE: hcloud.pl storage-box disable-protection <storage-box>';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 with 'WWW::Hetzner::CLI::Role::WaitsForAction';
10  
11 1 ▶sub execute {
Subroutine execute: called CC=3 SCAR=11.3
Pod undocumented
12 1 my ($self, $args, $chain) = @_;
13 1 ▶ my $id = $args->[0] or die "Usage: hcloud.pl storage-box disable-protection <storage-box>\n";
Branch: 1 branch
BranchTrueFalseTotal
my $id = $args->[0] or die "Usage: hcloud.pl storage-box disable-protection <storage-box>\n" 1 0 1
14 1 my $action = $chain->[0]->storage->storage_boxes->change_protection($id, delete => 0);
15 1 $self->handle_action($action);
16 1 ▶ print $self->no_wait ? "Storage Box protection change requested.\n" : "Storage Box protection disabled.\n";
Branch: 1 branch
BranchTrueFalseTotal
$self->no_wait ? : 1 0 1
17 }
18  
19 1 1;
20  
21 __END__
« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Delete.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/DisableSnapshotPlan.pm »