Branch Coverage

blib/lib/Getopt/Alt.pm
Criterion Covered Total %
branch 106 144 73.6


line true false branch
219 1 33 if ($conf->{'aliases'})
232 3 1 if (@args > 2 and ref $args[0] eq 'HASH' and ref $args[1] ne 'ARRAY')
241 14 0 if not $self->help_package or $self->help_package eq 'Getopt::Alt'
246 3 4 if (ref $_ and ref $_ eq 'Getopt::Alt::Exception' and $_->help)
253 4 0 if not $self->help_package or $self->help_package eq 'Getopt::Alt'
258 0 8 unless defined $self
260 0 8 wantarray ? :
266 71 16 $passed_args ? :
281 33 61 if ($arg =~ /^-- (\w[^=\s]+) (?:= (.*) )?/msx) { }
55 6 elsif ($arg =~ /^- (\w) =? (.*)/msx) { }
0 6 elsif ($arg eq '--') { }
290 0 0 if ($self->auto_complete and $self->opt->auto_complete and path($0)->basename eq path($args[0])->basename)
296 0 0 if ($self->opt->auto_complete and $self->sub_command and $self->has_auto_complete_shortener)
307 4 2 $self->sub_command ? :
311 3 80 if (defined $new_value)
320 0 78 if ($self->opt->auto_complete and $opt_name eq 'auto_complete_list')
322 0 0 $EXIT ? :
326 2 8 if (not $used and $short and defined $arg_data and length $arg_data)
329 0 0 if ($self->has_conf_section and $self->conf_section and $self->conf_section eq $opt_name and @args_orig)
346 2 14 if ($_ eq "next\n") { }
4 10 elsif ($_ eq "last\n") { }
351 0 4 if ($self->aliases->{$arg})
360 7 3 if ref $_ eq 'ARRAY' and @$_ == 1
362 0 10 if ($self->has_auto_complete and $self->opt->auto_complete) { }
370 2 82 if $action eq 'next'
371 4 78 if $action eq 'last'
374 4 73 if ($self->has_sub_command)
375 0 4 if @{$self->files;} and $self->files->[0] eq '--'
377 0 4 if (not @{$self->files;} and @args)
381 4 0 if not $self->cmd and @{$self->files;}
383 13 64 if (not $passed_args and $self->files)
387 4 73 if ($self->has_sub_command)
388 3 1 if (ref $self->sub_command eq 'HASH' and !$self->has_auto_complete || $self->cmd && $self->sub_command->{$self->cmd}) { }
0 1 elsif ($self->sub_command =~ /^[A-Z].*::$/ and !$self->has_auto_complete || $self->cmd && $self->sub_command->{$self->cmd}) { }
394 0 3 unless ($self->sub_command->{$self->cmd})
396 0 0 unless $self->help_package
403 3 0 if (ref $self->sub_command->{$self->cmd} eq 'ARRAY')
407 2 1 @$sub == 2 && ref $sub->[0] eq 'HASH' && ref $sub->[1] eq 'ARRAY' ? :
410 2 1 %$options ? :
418 1 2 unless $options->{'default'}
423 0 3 if ($self->opt->auto_complete)
442 11 66 if ($self->help_package)
443 1 10 if ($self->opt->{'version'}) { }
1 9 elsif ($self->opt->{'man'}) { }
1 8 elsif ($self->opt->{'help'}) { }
0 8 elsif ($self->auto_complete and $self->opt->auto_complete) { }
0 15 elsif ($self->sub_command and not $self->cmd) { }
445 1 0 defined $main::VERSION ? :
471 2 2 if ($self->sub_command and not $self->cmd) { }
2 0 elsif ($ARGV[-1] and $ARGV[-1] =~ /^-/msx) { }
473 2 2 $cmd ? :
478 14 0 $cmd ? :
486 0 4 $EXIT ? :
500 12 21 if grep {$name eq $_;} 'auto_complete', 'auto-complete', 'auto_complete_list', 'auto-complete-list'
507 6 15 length $_ == 1 ? :
515 3 91 if ($has_no and $long)
524 30 595 if $long and $opt->name eq $long
527 0 1098 if defined $long and $name eq $long
528 50 1048 if defined $short and $name eq $short
532 3 11 if ($long and $long =~ /^\d+$/msx or defined $short and $short =~ /^\d$/msx)
536 3 9 if $opt->number
540 6 5 unless $has_no
542 3 2 if ($self->help_package) { }
543 1 2 $long ? :
1 2 $long ? :
549 1 1 $long ? :
1 1 $long ? :
561 0 6 if ($self->help_packages and $self->cmd) { }
6 0 elsif ($self->help_package and $self->help_package ne '1') { }
563 0 0 if ($package)
572 6 0 unless (-f $help)
583 0 6 $msg ? :