| 1 | #!/usr/bin/env perl | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # PODNAME: dest | ||||||||||||||||||||||||||||
| 6 | # ABSTRACT: Deployment State Manager | ||||||||||||||||||||||||||||
| 7 | 2 | our $VERSION = '1.37'; # VERSION | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | ▶ | use Pod::Usage 'pod2usage'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use App::Dest; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | my @commands = qw( | |||||||||||||||||||||||||||
| 13 | init add rm | ||||||||||||||||||||||||||||
| 14 | watches putwatch writewatch | ||||||||||||||||||||||||||||
| 15 | make expand list prereqs | ||||||||||||||||||||||||||||
| 16 | status diff clean preinstall nuke | ||||||||||||||||||||||||||||
| 17 | deploy redeploy revdeploy verify revert update | ||||||||||||||||||||||||||||
| 18 | man version | ||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 2 | my ( $command, @args ) = @ARGV; | |||||||||||||||||||||||||||
| 22 | 2 | ▶ | ( $command = lc( $command || 'undef' ) ) =~ s/^\-+//; | ||||||||||||||||||||||||||
|
Condition50%1/2
$command || 'undef'
MC/DC0%0/1
$command || 'undef'
$command
Truth table50%1/2
A
A= $command
| |||||||||||||||||||||||||||||
| 23 | 2 | my @command = grep { index( $_, $command ) == 0 } @commands; | |||||||||||||||||||||||||||
| 24 | 2 | ($command) = @command; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 1 | ▶ | sub usage { | ||||||||||||||||||||||||||
|
Subroutine
usage: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 27 | 1 | pod2usage( | |||||||||||||||||||||||||||
| 28 | '-exitval' => 1, | ||||||||||||||||||||||||||||
| 29 | '-verbose' => $_[0], | ||||||||||||||||||||||||||||
| 30 | '-input' => 'App/Dest.pm', | ||||||||||||||||||||||||||||
| 31 | '-pathlist' => \@INC, | ||||||||||||||||||||||||||||
| 32 | ); | ||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 2 | ▶ | usage(1) if ( not @command or @command > 1 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not @command or @command > 1
MC/DC50%1/2
not @command or @command > 1
not @command
@command > 1
Truth table66%2/3
not(A) or B
A= not @commandB= @command > 1
| |||||||||||||||||||||||||||||
| 36 | 1 | ▶ | usage(2) if ( $command eq 'man' ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 1 | exit App::Dest->$command(@args); | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||