blib/lib/Tapper/CLI/Init.pm

filter: Statementstmt 48.2% 14 / 29 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 44.4% 20 / 45 CC 4 SCAR 23.5
CC
4
Cov
39%
init
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 10.5
« blib/lib/Tapper/CLI/DbDeploy/Command/makeschemadiffs.pm ↑ Summary blib/lib/Tapper/CLI/Precondition.pm »
1 package Tapper::CLI::Init;
2 72 our $AUTHORITY = 'cpan:TAPPER';
3 72 $Tapper::CLI::Init::VERSION = '5.0.8';
4 72 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 72 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 72 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 sub init
10 0 ▶{
Subroutine init: not called CC=4 SCAR=30.0
Pod documented
11 0 my ($c) = @_;
12 0 $c->getopt( 'quiet|q', 'help|?', 'default|d' );
13  
14 0 my $use_defaults = $c->options->{default};
15 0 ▶ if ( $c->options->{help} or not $use_defaults ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($c->options->{"help"} or not $use_defaults) 0 0 0
Condition0%0/3
$c->options->{"help"} or not $use_defaults
l!l&&r!l&&!r
000
MC/DC0%0/2
$c->options->{"help"} or not $use_defaults
$c->options->{"help"} not $use_defaults
Truth table0%0/3
A or not(B)
A= $c->options->{"help"}B= not $use_defaults
ABresult
1X1
011
000
16 0 say STDERR "Usage: $0 init --default|d [ --quiet ]";
17 0 say STDERR "";
18 0 say STDERR " --default Use default values for all parameters (currently required)";
19 0 say STDERR " --quiet Stay silent.";
20 0 say STDERR " --help Print this help message and exit.";
21 0 exit -1;
22 }
23  
24 my %options = ( $use_defaults ?
25 (
26 db => "SQLite",
27 )
28 : (
29 db => $c->options->{db},
30 0 ▶ ),
Branch: 1 branch
BranchTrueFalseTotal
$use_defaults ? : 0 0 0
31 );
32  
33 0 require Tapper::Cmd::Init;
34 0 my $cmd = Tapper::Cmd::Init->new;
35 0 $cmd->init(\%options);
36 0 return;
37 }
38  
39  
40  
41 sub setup
42 71 ▶{
Subroutine setup: called CC=1 SCAR=0.0
Pod documented
43 71 my ($c) = @_;
44 71 $c->register('init', \&init, 'Initialize $HOME/.tapper/ for non-root use-cases.');
45 71 return;
46 }
47  
48 72 1; # End of Tapper::CLI
49  
50 __END__
« blib/lib/Tapper/CLI/DbDeploy/Command/makeschemadiffs.pm ↑ Summary blib/lib/Tapper/CLI/Precondition.pm »