| 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 5 | require 5; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | package Getopt::Janus::SessionBase; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | $VERSION = '1.03'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use Getopt::Janus (); # makes sure Getopt::Janus::DEBUG is defined | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | BEGIN { *DEBUG = \&Getopt::Janus::DEBUG } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub get_option_values { die "ABSTRACTY" } # must override in subclass | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_option_values: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | ▶ | sub string { shift->register_option( 'string' , @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | ▶ | sub yes_no { shift->register_option( 'yes_no' , @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
yes_no: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | sub new_file { shift->register_option( 'new_file', @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new_file: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | sub file { shift->register_option( 'file' , @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 4 | ▶ | sub choose { shift->register_option( 'choose' , @_) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
choose: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub warm_up {''} # can override in subclass | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
warm_up: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 2 | ▶ | sub to_run_in_eval {''} # can override in subclass | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_run_in_eval: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub report_run_error { die 'ABSTRACTY'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
report_run_error: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | # must override in subclass, IF you override to_run_in_eval with a positive value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 5 | ▶ | use Carp qw( confess ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 5 | ▶ | use UNIVERSAL (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 2 | ▶ | sub set_title { $_[0]{'title'} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_title: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2 | ▶ | sub set_desc { $_[0]{'description'} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_desc: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 12 | ▶ | sub register_option { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_option: called CC=25 SCAR=33.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 12 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 12 | my $type = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 12 | my $slot = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 12 | my($long, $short) = @$self{ 'long', 'short' }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 12 | DEBUG > 1 and print "Register_option is hitting $type with options ", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | map("<$_> ", @_), "\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 12 | ▶ | confess "Not enough options to $short?!" unless @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 12 | my($short_count, $long_count); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 12 | my $new = { 'type' => $type, 'slot' => $slot }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 12 | ▶ | while( @_ and defined $_[0] and !ref($_[0]) and $_[0] =~ m/^-/s ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
@_ and defined $_[0] and not ref $_[0] and $_[0] =~ /^-/s
@_ and defined $_[0] and not ref $_[0]
@_ and defined $_[0]
MC/DC75%3/4
@_ and defined $_[0] and not ref $_[0] and $_[0] =~ /^-/s
@_
defined $_[0]
not ref $_[0]
$_[0] =~ /^-/s
Truth table80%4/5
A and B and not(C) and D
A= @_B= defined $_[0]C= not ref $_[0]D= $_[0] =~ /^-/s
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 17 | my $switch = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 17 | ▶ | if($switch =~ s/^-([_0-9a-zA-Z])$/$1/s) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 11 | DEBUG > 2 and print "Declaring with short switch -$switch\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | confess "But there's already a \"-$switch\" switch defined!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 11 | ▶ | if $short->{$switch} and $short->{$switch}{'type'} ne 'HELP'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$short->{$switch} and $short->{$switch}{"type"} ne "HELP"
MC/DC0%0/2
$short->{$switch} and $short->{$switch}{"type"} ne "HELP"
$short->{$switch}
$short->{$switch}{"type"} ne "HELP"
Truth table33%1/3
A and B
A= $short->{$switch}B= $short->{$switch}{"type"} ne "HELP"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 11 | $short->{$switch} = $new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 11 | $new->{'short'} = $switch; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 11 | ++$short_count; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | } elsif($switch =~ s/^--([-_0-9a-zA-Z]{2,})$/$1/s) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 6 | DEBUG > 2 and print "Declaring with long switch --$switch\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | confess "But there's already a \"--$switch\" switch defined!" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 6 | ▶ | if $long->{$switch} and $long->{$switch}{'type'} ne 'HELP'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$long->{$switch} and $long->{$switch}{"type"} ne "HELP"
MC/DC0%0/2
$long->{$switch} and $long->{$switch}{"type"} ne "HELP"
$long->{$switch}
$long->{$switch}{"type"} ne "HELP"
Truth table33%1/3
A and B
A= $long->{$switch}B= $long->{$switch}{"type"} ne "HELP"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 6 | $long->{$switch} = $new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 6 | $new->{'long'} = $switch; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 6 | ++$long_count; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | confess "Illegal switchname \"$switch\" being declared"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 12 | ▶ | confess "No switchnames specified!?" unless $long_count || $short_count; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$long_count or $short_count
MC/DC0%0/2
$long_count or $short_count
$long_count
$short_count
Truth table66%2/3
A or B
A= $long_countB= $short_count
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | # string $x, '-x'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | # string $x, '-x', \'Thingy', k=>v, k=>v,...; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | # string $x, '-x', \'Thingy', \'This is a thingy', k=>v, k=>v,...; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 12 | ▶ | if(@_ and ref($_[0] || '') eq 'SCALAR') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition80%4/5
@_ and ref($_[0] || "") eq "SCALAR"
$_[0] || ''
MC/DC50%1/2
@_ and ref($_[0] || "") eq "SCALAR"
@_
$_[0]
Truth table66%2/3
A and B
A= @_B= $_[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 6 | $new->{'title'} = ${ shift(@_) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 6 | DEBUG > 2 and print "Noting option-title \"$$new{'title'}\"\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 6 | ▶ | if(@_ and ref($_[0] || '') eq 'SCALAR') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition60%3/5
@_ and ref($_[0] || "") eq "SCALAR"
$_[0] || ''
MC/DC50%1/2
@_ and ref($_[0] || "") eq "SCALAR"
@_
$_[0]
Truth table66%2/3
A and B
A= @_B= $_[0]
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 4 | $new->{'description'} = ${ shift(@_) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 4 | DEBUG > 2 and print "Noting option-desc \"$$new{'description'}\"\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 12 | ▶ | confess "Uneven number of parameter items in call to $type: @_" if @_ % 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 12 | ▶ | while( @_ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 4 | my($k,$v) = splice(@_,0,2); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 4 | ▶ | confess "Can't use undef as an parameter name!" unless defined $k; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 4 | ▶ | confess "Can't use empty-string as an parameter name!" unless length $k; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 4 | DEBUG > 2 and print "Setting parameter \"$k\" to ", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | defined($v) ? "\"$v\"" : "(undef)", ".\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 4 | ▶ | confess "Parameter \"$k\" is already set!" if exists $new->{$k}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 4 | $new->{$k} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 12 | $self->note_new_option( $new ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 12 | push @{ $self->{'options'} }, $new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 12 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 12 | ▶ | sub note_new_option { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
note_new_option: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 12 | my($self, $option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 12 | my $m = 'note_new_option_' . $option->{'type'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 12 | ▶ | $self->$m($option) if $self->can($m); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 12 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 2 | ▶ | sub prep_options { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prep_options: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 2 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 2 | foreach my $o (@{ $self->{'options'} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 12 | $self->prep_option($o); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 12 | ▶ | sub prep_option { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prep_option: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 12 | my($self, $option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 12 | my $m = 'prep_option_' . $option->{'type'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 12 | ▶ | $self->$m($option) if $self->can($m); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 12 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 4 | ▶ | sub prep_option_choose { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prep_option_choose: called CC=7 SCAR=21.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 4 | my($self, $option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 4 | ▶ | my $c = ($option->{'from'} ||= ['NONE DEFINED']); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$option->{"from"} ||= ["NONE DEFINED"]
MC/DC0%0/1
$option->{"from"} ||= ["NONE DEFINED"]
$option->{"from"}
Truth table50%1/2
A
A= $option->{"from"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 4 | ▶ | return unless @$c; # I guess? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | # Force it to be one of the choices | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 4 | for my $val ( ${ $option->{'slot'} } ) { # "for" just to get aliasing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 4 | ▶ | if(defined $val) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | # just fall thru to the check | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } elsif(defined $option->{'default'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $val = $option->{'default'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 4 | $val = $c->[0]; # most common case: set to first. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 4 | ▶ | confess "$val isn't any of the allowed values {@$c}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | unless grep $val eq $_, @$c; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 2 | ▶ | sub prep_option_string { } # I can't thing of anything that needs doing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prep_option_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 2 | ▶ | sub prep_option_yes_no { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prep_option_yes_no: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 2 | my($self, $option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 2 | for my $val ( ${ $option->{'slot'} } ) { # "for" just to get aliasing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 2 | $val = !! $val; # reduce to just boolean | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 2 | ▶ | sub prep_option_new_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prep_option_new_file: called CC=6 SCAR=20.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 2 | my($self, $option) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 2 | for my $slot ( $option->{'slot'} ) { # happy aliasing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 2 | ▶ | if( defined $$slot and $$slot =~ m/\e/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $$slot and $$slot =~ /\e/
MC/DC0%0/2
defined $$slot and $$slot =~ /\e/
defined $$slot
$$slot =~ /\e/
Truth table33%1/3
A and B
A= defined $$slotB= $$slot =~ /\e/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 2 | $$slot = $self->_new_out( $$slot ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 2 | ▶ | if( defined $$slot and length $$slot) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $$slot and length $$slot
MC/DC0%0/2
defined $$slot and length $$slot
defined $$slot
length $$slot
Truth table33%1/3
A and B
A= defined $$slotB= length $$slot
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 2 | push @Getopt::Janus::New_files, $slot; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | DEBUG and print "Potential new-file: $slot", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | ref($slot) ? " ($$slot)" : '', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | "\n from ", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 2 | $option->{'long'} || $option->{'short'}, ".\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | DEBUG and print "Snoozing thru new-file option ", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | $option->{'long'} || $option->{'short'}, ".\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | #========================================================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 2 | ▶ | sub run { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
run: called CC=11 SCAR=31.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 2 | my($self, $sub, $title, $desc) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 2 | ▶ | confess "first argument to run() should be a subref" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $sub and UNIVERSAL::isa($sub, "CODE")
MC/DC0%0/2
ref $sub and UNIVERSAL::isa($sub, "CODE")
ref $sub
UNIVERSAL::isa($sub, "CODE")
Truth table33%1/3
A and B
A= ref $subB= UNIVERSAL::isa($sub, "CODE")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | unless ref($sub) and UNIVERSAL::isa($sub, 'CODE'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 2 | ▶ | $title = $$title if $title and ref($title) eq 'SCALAR'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$title and ref $title eq "SCALAR"
MC/DC0%0/2
$title and ref $title eq "SCALAR"
$title
ref $title eq "SCALAR"
Truth table33%1/3
A and B
A= $titleB= ref $title eq "SCALAR"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 2 | ▶ | $desc = $$desc if $desc and ref($desc ) eq 'SCALAR'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$desc and ref $desc eq "SCALAR"
MC/DC0%0/2
$desc and ref $desc eq "SCALAR"
$desc
ref $desc eq "SCALAR"
Truth table33%1/3
A and B
A= $descB= ref $desc eq "SCALAR"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 2 | ▶ | $self->set_title($title || $0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$title || $0
MC/DC0%0/2
$title || $0
$title
$0
Truth table33%1/3
A || B
A= $titleB= $0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 2 | ▶ | $self->set_desc($desc) if $desc; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 2 | $self->prep_options; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 2 | $self->get_option_values; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 2 | ▶ | if( $self->to_run_in_eval ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | DEBUG and print "Running $sub in an eval...\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | eval { local $SIG{'__DIE__'}; &$sub; }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | if( $@ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | DEBUG and print "That threw an error: $@\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $self->report_run_error($@); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | DEBUG and print "That didn't throw any errors.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 2 | DEBUG and print "Not running $sub in an eval.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 2 | &$sub; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 2 | DEBUG and print "Starting cleanup.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 2 | $self->cleanup(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 2 | DEBUG and print "Ending cleanup.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 2 | DEBUG and print "Now exiting.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 2 | exit; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | #========================================================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 2 | ▶ | sub cleanup { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cleanup: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 2 | $self->review_result( \@Getopt::Janus::New_files ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | #========================================================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | sub review_result { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
review_result: not called CC=16 SCAR=56.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | my($self, $them) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | unless(@$them) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | DEBUG and print "No files to consider.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | require File::Basename; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | if(DEBUG > 1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | print "Contents of new_files:\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | foreach my $i (@$them) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | print " [", ref($i) ? "$i = $$i" : $i, "]\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | my(@to_display, %seen, $f_out); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | foreach my $f (@$them) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | next unless defined $f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | $f = $$f if ref $f eq 'SCALAR'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | ▶ | next unless defined $f and length $f; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $f and length $f
MC/DC0%0/2
defined $f and length $f
defined $f
length $f
Truth table0%0/3
A and B
A= defined $fB= length $f
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | DEBUG > 2 and print " Considering [$f]\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | return if $f eq ".NO."; # magic value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | next if $seen{$f}++; # no repeats | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | unless( -e $f ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | DEBUG and print " $f doesn't exist\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | unless( -r _ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | DEBUG and print " $f doesn't readable\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | ▶ | if(-f _) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | if(-s _) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | DEBUG and print " A good file: $f\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | $f_out = $f; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | DEBUG and print " But it's 0-length: $f\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | $f_out = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | my $d = File::Basename::dirname( $f ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | $d = '.' if $d eq $f or !length $d; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$d eq $f or not length $d
MC/DC0%0/2
$d eq $f or not length $d
$d eq $f
not length $d
Truth table0%0/3
A or not(B)
A= $d eq $fB= not length $d
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | push @to_display, [$f => $d]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | } elsif(-d _) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | DEBUG and print " A dir: $f\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | push @to_display, [undef => $f]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | DEBUG and print " Odd, what's a $f ?!\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | if(DEBUG > 1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | print "Contents of to_display: [\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | foreach my $i (@to_display) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | print " [", ref($i) ? "$i = $$i" : $i, "]\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | print "]\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $self->review_result_screen(\@to_display); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | sub review_result_screen { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
review_result_screen: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | my($self, $to_display) = @_; # override in a subclass | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | ▶ | return unless @$to_display; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | sub can_open_files { $^O =~ m/Win32/ or $^O =~ m/darwin/ }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_open_files: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | ▶ | sub can_open_directories { $^O =~ m/Win32/ or $^O =~ m/darwin/ }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
can_open_directories: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | sub open_directory { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
open_directory: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | my($self, $i) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | ▶ | return $self->open_file($i) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$^O =~ /Win32/ or $^O =~ /darwin/
MC/DC0%0/2
$^O =~ /Win32/ or $^O =~ /darwin/
$^O =~ /Win32/
$^O =~ /darwin/
Truth table0%0/3
A or B
A= $^O =~ /Win32/B= $^O =~ /darwin/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | if $^O =~ m/Win32/ or $^O =~ m/darwin/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | sub open_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
open_file: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | my($self, $i) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | if($^O =~ m/darwin/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | # Thanks to Elaine Ashton and Anno Siegel for help on this | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | ▶ | return unless defined $i and length $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $i and length $i
MC/DC0%0/2
defined $i and length $i
defined $i
length $i
Truth table0%0/3
A and B
A= defined $iB= length $i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | DEBUG and print "\nCalling system 'open', $i\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | sleep 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | system "open", $i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | sleep 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | DEBUG and print "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | } elsif($^O =~ m/Win32/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | # Thanks to Elaine Ashton and Anno Siegel for help on this | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | return unless defined $i and length $i; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $i and length $i
MC/DC0%0/2
defined $i and length $i
defined $i
length $i
Truth table0%0/3
A and B
A= defined $iB= length $i
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | DEBUG and print "Calling system 'start', qq{\"$i\"}\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | sleep 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | system "start", qq{"$i"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | sleep 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | DEBUG and print "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | #========================================================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 2 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 2 | ▶ | $class = ref($class) || $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 2 | my $new = bless { short => {}, long => {}, options => [] }, $class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 2 | DEBUG and print "New $class object.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 2 | $new->_init; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 2 | return $new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | # can override in a subclass, if you also call $self->SUPER::_init | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 2 | ▶ | sub _init { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 2 | my $self = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | $self->{'long' }{'help'} = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | $self->{'short'}{'h' } = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 'type' => 'HELP', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 'short' => 'h', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 'long' => 'help', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 2 | 'slot' => do { my $x; \$x; }, # a dummy slot | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 'title' => "Usage summary / general help", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | #========================================================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 2 | ▶ | sub _new_out { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_new_out: called CC=11 SCAR=26.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | # Use like: $outname = $self->_new_out("thing\e.txt"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | # "\e" means "provide an incremented number here" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 2 | my($self, $in) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | 2 | ▶ | confess "Can't go on the basis of a null file-specification" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $in and length $in
MC/DC0%0/2
defined $in and length $in
defined $in
length $in
Truth table33%1/3
A and B
A= defined $inB= length $in
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | unless defined $in and length $in; # sanity | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 2 | require File::Basename; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 2 | my $pattern = File::Basename::basename($in); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 2 | my($before, $after) = split "\e", $pattern, 2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 2 | ▶ | $after = '' unless defined $after; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | # whip up the pattern: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 2 | my $pat_before = quotemeta $before; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 2 | my $pat_after = quotemeta $after; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 2 | $pattern = qr/^$pat_before(\d+)$pat_after$/is; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 2 | DEBUG > 1 and print "Made pattern $pattern from $in\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | # Look for matching files: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | 2 | my $dir = File::Basename::dirname($in); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 2 | DEBUG > 2 and print "Dirname of [$in] is [$dir]\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 2 | DEBUG > 1 and print "opendir on $dir for $in\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 2 | ▶ | $dir = '.' unless defined $dir; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 2 | ▶ | opendir(GOODINDIR, $dir) || confess "Can't opendir $dir: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 2 | my $max = -1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 2 | my $this; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 2 | ▶ | while( defined($this = readdir(GOODINDIR)) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 30 | ▶ | next unless $this =~ $pattern; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 0 | ▶ | if( $1 > $max ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | $max = 0 + $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 0 | DEBUG > 5 and print " Hm, $this is highest so far.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | 2 | closedir(GOODINDIR); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | # Now make a filename with one greater: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 2 | ▶ | if( $max == -1 ) { # none seen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | 2 | $max = 100; # a good starting number | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | $max++; # just use one higher than the max | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 2 | my $out = $in; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 2 | ▶ | $out =~ s/\e/$max/ or $out .= $max; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | 2 | DEBUG > 1 and print "_better_out returns $out\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | 2 | return $out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | #========================================================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | # Generate the methods for particular licenses: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 5 | foreach my $licname (qw< artistic gnu either >) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 2 | ▶ | my $sub = sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 2 | require Getopt::Janus::Licenses; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | 2 | @{ $_[0] }{ 'license', 'license_short' } = do { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 5 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 2 | *{"Getopt::Janus::Licenses::$licname"}{CODE} , | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 2 | *{"Getopt::Janus::Licenses::$licname\_short"}{CODE}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | 15 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 5 | ▶ | { no strict 'refs'; *{"license_$licname"} = $sub; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 0 | ▶ | sub _help_message { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_help_message: not called CC=30 SCAR=68.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 0 | my($self, $long) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | 0 | ▶ | $long ||= ''; # so it's not undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$long ||= ""
MC/DC0%0/1
$long ||= ""
$long
Truth table0%0/2
A
A= $long
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 0 | ▶ | my @out = "Options:\n" . ($long && "\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$long && "\n"
MC/DC0%0/1
$long && "\n"
$long
Truth table0%0/2
A
A= $long
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | unshift @out, ( join ' -- ', grep $_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | $self->{'title'}, $self->{'description'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 0 | ▶ | ) . "\n" . ($long && "\n") if $self->{'description'} or $self->{'title'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
$self->{"description"} or $self->{"title"}
$long && "\n"
MC/DC0%0/2
$self->{"description"} or $self->{"title"}
$self->{"description"}
$self->{"title"}
MC/DC0%0/1
$long && "\n"
$long
Truth table0%0/3
A or B
A= $self->{"description"}B= $self->{"title"}
Truth table0%0/2
A
A= $long
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 0 | my($type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | my %seen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | foreach my $o (@{ $self->{'options'} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | my $switch = $o->{'short'} ? ( '-' . $o->{'short'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | ▶ | : $o->{'long' } ? ('--' . $o->{'long' }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | : next | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 0 | ▶ | ++$seen{ $o->{'short'} } if defined $o->{'short'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | 0 | ▶ | ++$seen{ $o->{'long' } } if defined $o->{'long' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 0 | ▶ | $type = $o->{'type'} || 'No type'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$o->{'type'} || 'No type'
MC/DC0%0/1
$o->{'type'} || 'No type'
$o->{'type'}
Truth table0%0/2
A
A= $o->{'type'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 0 | ▶ | if( $type eq 'yes_no' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | # nothing to add | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | } elsif( $type eq 'string' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | $switch .= '=value'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | } elsif( $type eq 'file' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | $switch .= "=file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | } elsif( $type eq 'new_file' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | 0 | $switch .= "=new_file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | } elsif( $type eq 'choose' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | $switch .= join '' => ( "=option", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | $long ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | 0 | ( "\n (One of: ", join(q<, >, map qq{"$_"}, @{$o->{'from'}}) ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 0 | ▶ | : ( " (one of: ", join(q<|>, @{$o->{'from'}}) ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | ")" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 0 | $switch .= " [of type $type]" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 0 | ▶ | if($long and $o->{'short'} and $o->{'long'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$long and $o->{"short"} and $o->{"long"}
$long and $o->{"short"}
MC/DC0%0/3
$long and $o->{"short"} and $o->{"long"}
$long
$o->{"short"}
$o->{"long"}
Truth table0%0/4
A and B and C
A= $longB= $o->{"short"}C= $o->{"long"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 0 | ▶ | $switch =~ s[^(-.(\S*))] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | [$1 or --$$o{'long'}$2]s | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | or (DEBUG and print "INSANE switch value $switch\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | push @out, $long ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | ("$switch\n ", $o->{'description'} || $o->{'title'} || '') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 0 | ▶ | : ("$switch :: " , $o->{'title'} || $o->{'description'} || ''), "\n" ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/10
$o->{"description"} or $o->{"title"} or ""
$o->{"description"} or $o->{"title"}
$o->{"title"} or $o->{"description"} or ""
$o->{"title"} or $o->{"description"}
MC/DC0%0/2
$o->{"description"} or $o->{"title"} or ""
$o->{"description"}
$o->{"title"}
MC/DC0%0/2
$o->{"title"} or $o->{"description"} or ""
$o->{"title"}
$o->{"description"}
Truth table0%0/3
A or B
A= $o->{"description"}B= $o->{"title"}
Truth table0%0/3
A or B
A= $o->{"title"}B= $o->{"description"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 0 | ▶ | push @out, "-h :: show a short help message\n" unless $seen{'h'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | 0 | ▶ | push @out, "--help :: show a long help message\n" unless $seen{'help'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | 0 | ▶ | push @out, "\n", $self->{'license_short'}->() if $self->{'license_short'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | return join '', @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | 0 | ▶ | sub short_help_message { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
short_help_message: not called CC=19 SCAR=59.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 0 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | 0 | my @out = "Options:\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | unshift @out, ( join ' -- ', grep $_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | $self->{'title'}, $self->{'description'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 0 | ▶ | ) . "\n" if $self->{'description'} or $self->{'title'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"description"} or $self->{"title"}
MC/DC0%0/2
$self->{"description"} or $self->{"title"}
$self->{"description"}
$self->{"title"}
Truth table0%0/3
A or B
A= $self->{"description"}B= $self->{"title"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | 0 | my($type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | my %seen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | foreach my $o (@{ $self->{'options'} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | my $switch = $o->{'short'} ? ( '-' . $o->{'short'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | 0 | ▶ | : $o->{'long' } ? ('--' . $o->{'long' }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | : next | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | 0 | ▶ | ++$seen{ $o->{'short'} } if defined $o->{'short'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | 0 | ▶ | ++$seen{ $o->{'long' } } if defined $o->{'long' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 0 | ▶ | $type = $o->{'type'} || 'No type'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$o->{'type'} || 'No type'
MC/DC0%0/1
$o->{'type'} || 'No type'
$o->{'type'}
Truth table0%0/2
A
A= $o->{'type'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | 0 | ▶ | if( $type eq 'yes_no' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | # nothing to add | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | } elsif( $type eq 'string' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | $switch .= '=value'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | } elsif( $type eq 'file' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | 0 | $switch .= "=file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | } elsif( $type eq 'new_file' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 0 | $switch .= "=new_file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | } elsif( $type eq 'choose' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | 0 | $switch .= "=option (one of: " . join(q<|>, @{$o->{'from'}}) . ")"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | 0 | $switch .= " [of type $type]" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | push @out, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 0 | ▶ | "$switch :: ", $o->{'title'} || $o->{'description'} || '', "\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$o->{'title'} || $o->{'description'} || ''
$o->{"title"} or $o->{"description"}
MC/DC0%0/2
$o->{'title'} || $o->{'description'} || ''
$o->{"title"}
$o->{"description"}
Truth table0%0/3
A or B
A= $o->{"title"}B= $o->{"description"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | 0 | ▶ | push @out, "-h :: show a short help message\n" unless $seen{'h'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 0 | ▶ | push @out, "--help :: show a long help message\n" unless $seen{'help'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 0 | ▶ | push @out, "\n", $self->{'license_short'}->() if $self->{'license_short'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 0 | return join '', @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | 0 | ▶ | sub long_help_message { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
long_help_message: not called CC=22 SCAR=62.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | my($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | 0 | my @out = "Options:\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | unshift @out, ( join ' -- ', grep $_, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | $self->{'title'}, $self->{'description'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | 0 | ▶ | ) . "\n\n" if $self->{'description'} or $self->{'title'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"description"} or $self->{"title"}
MC/DC0%0/2
$self->{"description"} or $self->{"title"}
$self->{"description"}
$self->{"title"}
Truth table0%0/3
A or B
A= $self->{"description"}B= $self->{"title"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | 0 | my($type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | my %seen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | 0 | foreach my $o (@{ $self->{'options'} } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | my $switch = $o->{'short'} ? ( '-' . $o->{'short'}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | 0 | ▶ | : $o->{'long' } ? ('--' . $o->{'long' }) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | : next | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 0 | ▶ | ++$seen{ $o->{'short'} } if defined $o->{'short'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | 0 | ▶ | ++$seen{ $o->{'long' } } if defined $o->{'long' }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 0 | ▶ | $type = $o->{'type'} || 'No type'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$o->{'type'} || 'No type'
MC/DC0%0/1
$o->{'type'} || 'No type'
$o->{'type'}
Truth table0%0/2
A
A= $o->{'type'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | 0 | ▶ | if( $type eq 'yes_no' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | # nothing to add | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | } elsif( $type eq 'string' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 0 | $switch .= '=value'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | } elsif( $type eq 'file' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | 0 | $switch .= "=file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | } elsif( $type eq 'new_file' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 0 | $switch .= "=new_file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | } elsif( $type eq 'choose' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | $switch .= "=option\n (One of: " . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | 0 | join(q<, >, map qq{"$_"}, @{$o->{'from'}}) . ")"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 0 | $switch .= " [of type $type]" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 0 | ▶ | if($o->{'short'} and $o->{'long'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$o->{"short"} and $o->{"long"}
MC/DC0%0/2
$o->{"short"} and $o->{"long"}
$o->{"short"}
$o->{"long"}
Truth table0%0/3
A and B
A= $o->{"short"}B= $o->{"long"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | 0 | ▶ | $switch =~ s/^(-.(\S*))/$1 or --$$o{'long'}$2/s or print "WHAT $switch"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | push @out, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | 0 | ▶ | "$switch\n ", $o->{'description'} || $o->{'title'} || '', "\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/5
$o->{'description'} || $o->{'title'} || ''
$o->{"description"} or $o->{"title"}
MC/DC0%0/2
$o->{'description'} || $o->{'title'} || ''
$o->{"description"}
$o->{"title"}
Truth table0%0/3
A or B
A= $o->{"description"}B= $o->{"title"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | 0 | ▶ | push @out, "-h :: show a short help message\n" unless $seen{'h'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | 0 | ▶ | push @out, "--help :: show a long help message\n" unless $seen{'help'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | 0 | ▶ | push @out, "\n", $self->{'license_short'}->() if $self->{'license_short'}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 0 | return join '', @out; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||