bin/mvr

filter: Statementstmt 100% 35 / 35 Branchbran 70.0% 7 / 10 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 91.0% 51 / 56 CC 1 SCAR 0.0
CC
1
Cov
91%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/App/mvr.pm ↑ Summary
1 #!/usr/bin/env perl
2 package
3 mvr;
4 11 ▶use v5.14.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 our $VERSION = '0.005'; # VERSION
8 # PODNAME: mvr
9 # ABSTRACT: like mv, but clever
10  
11 11 ▶use Pod::Usage qw(pod2usage);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 11 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 11 ▶use App::mvr;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 11 my $verbose = 1;
17 11 ▶my %opts = ( quiet => sub { $verbose = 0 }, verbose => \$verbose, deduplicate => 1 );
Subroutine __ANON__: called CC=1 SCAR=0.0
18 11 ▶GetOptions( \%opts,
Branch: 1 branch
BranchTrueFalseTotal
&GetOptions(\%opts, "help|?", "version", "verbose|v+", "quiet!", "deduplicate!") or pod2usage("-verbose", 1) 11 0 11
19 'help|?',
20 'version',
21 'verbose|v+',
22 'quiet!',
23 'deduplicate!',
24 ) or pod2usage( -verbose => 1 );
25 11 ▶pod2usage( -verbose => 2 ) if $opts{help};
Branch: 1 branch
BranchTrueFalseTotal
if $opts{"help"} 0 11 11
26  
27 11 ▶if ($opts{version}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($opts{"version"}) 1 10 11
28 1 ▶ say __PACKAGE__ . ' version ' . (__PACKAGE__->VERSION // 'dev');
Condition50%1/2
__PACKAGE__->VERSION // "dev"
l!l
10
MC/DC0%0/1
__PACKAGE__->VERSION // "dev"
__PACKAGE__->VERSION
Truth table50%1/2
A
A= __PACKAGE__->VERSION
Aresult
11
00
29 1 exit;
30 }
31  
32 10 my @source;
33 10 ▶push @source, shift
Branch: 1 branch
BranchTrueFalseTotal
@ARGV > 1 and do { push @source, shift @ARGV } 10 10 20
34 while @ARGV > 1;
35 10 ▶pod2usage( -verbose => 0, -exitval => 1) unless @ARGV;
Branch: 1 branch
BranchTrueFalseTotal
unless @ARGV 0 10 10
36  
37 10 my $dest = shift;
38  
39 10 local $App::mvr::VERBOSE = $verbose;
40 10 mvr( source => \@source, dest => $dest, deduplicate => $opts{deduplicate} );
41  
42 __END__
« blib/lib/App/mvr.pm ↑ Summary