« 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
Condition0%0/3
$c->options->{"help"} or not $use_defaults
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
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||