Branch Coverage

blib/lib/OptArgs.pm
Criterion Covered Total %
branch 160 206 77.6


line true false branch
31 32 0 if (exists $args{$package})
32 12 0 exists $$_{'subcommands'} ? :
36 0 12 exists $$_{'fallback'} ? :
40 0 32 if ($SORT) { }
74 1 17 if (my(@missing) = grep({not exists $$params{$_};} @subcmd_required))
78 0 17 if (my(@invalid) = grep({not exists $subcmd_params{$_};} keys %$params))
88 10 7 ref $$params{'cmd'} eq 'ARRAY' ? :
90 0 17 unless @cmd
96 1 16 unless $seen{$parent}
101 1 15 if $seen{$package}
146 4 39 unless $name
147 2 37 if $seen{$package}{$name}
149 2 35 if (my(@missing) = grep({not exists $$params{$_};} @opt_required))
153 1 34 if (my(@invalid) = grep({not exists $opt_params{$_};} keys %$params))
158 1 33 if $$params{'ishelp'} and $$params{'isa'} ne 'Bool'
161 1 32 unless exists $opt_isa{$$params{'isa'}}
172 3 29 if ((my $dashed = $$params{'name'}) =~ s/_/-/g)
177 12 20 if $$params{'alias'}
216 4 28 unless $name
217 2 26 if $seen{$package}{$name}
219 2 24 if (my(@missing) = grep({not exists $$params{$_};} @arg_required))
223 1 23 if (my(@invalid) = grep({not exists $arg_params{$_};} keys %$params))
228 1 22 unless exists $arg_isa{$$params{'isa'}}
231 1 21 if defined $$params{'default'} and defined $$params{'required'}
234 1 20 if $$params{'fallback'} and $$params{'isa'} ne 'SubCmd'
237 1 19 if defined $$params{'fallback'} and ref $$params{'fallback'} ne 'HASH'
251 1 18 if ($$params{'fallback'})
271 0 7 $COLOUR && $terminal ? :
274 0 7 $COLOUR && $terminal ? :
285 0 7 defined &static::list ? :
287 3 4 if ($error)
291 2 5 $ishelp ? :
294 5 3 unless $seen{$parent}
300 3 4 if @parents
304 6 1 if ($last)
307 0 6 unless $$def{'required'}
309 0 6 if $$def{'greedy'}
310 0 6 unless $$def{'required'}
315 7 0 if @opts
319 2 5 if $ishelp and $desc{$caller}
322 0 7 if ($ishelp and my $version = $caller->VERSION)
326 4 3 if ($last and $$last{'isa'} eq 'SubCmd')
331 0 0 if exists $$last{'fallback'} and $ishelp || !$$last{'fallback'}{'hidden'}
338 1 3 if $SORT
343 0 10 if $hidden{$pkg} and not $ishelp
349 1 6 if $SORT
352 0 18 if $$opt{'hidden'} and not $ishelp
355 15 3 if $$opt{'alias'}
356 15 3 $$opt{'alias'} ? :
368 7 0 if (@uopts)
378 4 3 if (@usage)
383 2 5 if (@uargs and $$last{'isa'} ne 'SubCmd')
389 7 0 if (@uopts)
410 32 56 unless $seen{$parent}
415 28 4 if @parents
417 12 20 if (my $last = $args[$#args])
420 0 12 unless $$def{'required'}
422 0 12 if $$def{'greedy'}
423 0 12 unless $$def{'required'}
443 27 23 if (not @_ and @ARGV)
447 27 0 if ($CODESET)
455 0 84 if not defined $_
457 1 49 unless exists $opts{$package} or exists $args{$package}
473 155 55 if ($$try{'type'} eq 'opt') { }
55 0 elsif ($$try{'type'} eq 'arg') { }
477 34 21 if (@$source) { }
2 36 elsif ($$try{'required'} and not $ishelp) { }
478 0 34 if $$source[0] =~ /^--\S/
481 0 34 if $$source[0] =~ /^-\S/ and not $$source[0] =~ /^-\d/ && ($$try{'isa'} ne 'Num' || $$try{'isa'} ne 'Int')
488 2 32 if ($$try{'greedy'}) { }
490 0 2 if (@config and @$source > @config)
494 0 2 if ($$try{'isa'} eq 'ArrayRef') { }
0 2 elsif ($$try{'isa'} eq 'HashRef') { }
508 1 31 if ($$try{'isa'} eq 'ArrayRef') { }
1 30 elsif ($$try{'isa'} eq 'HashRef') { }
526 10 43 if ($$try{'isa'} eq 'SubCmd' and $result)
529 6 4 if ($ABBREV)
536 6 0 if defined $abbrev{$result}
542 8 2 if (exists $seen{$newpackage}) { }
2 0 elsif (not $ishelp) { }
548 1 1 if ($$try{'fallback'}) { }
565 51 155 if (defined $result) { }
16 139 elsif (defined $$try{'default'}) { }
569 8 8 if ref $$try{'default'} eq 'CODE'
574 2 204 if $result and $$try{'ishelp'}
578 2 46 if ($ishelp) { }
2 44 elsif ($missing_required) { }
2 42 elsif (@$source) { }
600 0 37 if $dispatching{$caller}
610 0 13 unless $caller
611 0 13 if $dispatching{$caller}
614 0 13 unless eval "require $caller;"
618 12 1 if (@_) { }
622 0 27 if (ref $element eq 'HASH') { }
625 0 0 defined $$element{$_} ? :
638 0 8 unless eval "require $class;1;"
646 2 14 unless $method and $class
647 1 13 unless eval "require $class;1;"
651 0 8 unless eval "require $package"
654 0 8 unless ($sub)
655 0 0 unless eval "require $package;"
659 0 8 unless $sub
664 4 4 if wantarray