Branch Coverage

lib/Pcore/Core/CLI.pm
Criterion Covered Total %
branch 17 146 11.6


line true false branch
28 0 5 if (my $cli_cmd = $self->spec->{'cmd'})
32 0 0 if (substr($cli_cmd_class, -2, 2) eq '::') { }
38 0 0 if ref $_
42 0 0 unless -d $path
45 0 0 if ($fn =~ /\A(.+)[.]pm\z/msu and -f "$path/$fn")
59 0 0 if $$index{$class}
65 0 0 if ($class->can('does') and $class->does('Pcore::Core::CLI::Cmd'))
85 0 5 if (my $cli_opt = $self->spec->{'opt'})
87 0 0 if exists $index->{$name}
93 0 0 if ($$opt{$name}->short)
94 0 0 if exists $$index{$$opt{$name}->short}
111 0 5 if (my $cli_arg = $self->spec->{'arg'})
113 0 0 if $next_arg == 2
119 0 0 if $next_arg == 1 and $arg->min != 0
121 0 0 if exists $$index{$arg->name}
123 0 0 if (not $arg->max) { }
0 0 elsif ($arg->min == 0) { }
144 0 0 if exists $index->{$cmd}
154 0 5 %{$self->_cmd_index} ? :
160 0 5 if ($self->spec->{'class'})
167 5 0 $argv ? :
169 0 5 if ($self->is_cmd) { }
204 0 0 if (not $$res{'cmd'} and substr($arg, 0, 1) ne '-') { }
213 0 0 $ENV->can_scan_deps ? :
215 0 0 if defined $argv and @$argv
218 0 0 if $ENV->can_scan_deps and $$res{'opt'}{'scan-deps'}
220 0 0 if ($$res{'opt'}{'version'}) { }
0 0 elsif (not defined $$res{'cmd'}) { }
224 0 0 if ($$res{'opt'}{'help'}) { }
237 0 0 if index($cmd_name, $$res{'cmd'}) == 0
240 0 0 if (not @$possible_commands) { }
0 0 elsif (@$possible_commands > 1) { }
247 0 0 if $$res{'opt'}{'help'}
311 0 5 $ENV->can_scan_deps ? :
313 0 5 if defined $argv and @$argv
317 0 5 if $ENV->can_scan_deps and $$res{'opt'}{'scan-deps'}
319 0 5 if ($$res{'opt'}{'version'}) { }
0 5 elsif ($$res{'opt'}{'help'}) { }
0 5 elsif ($$res{'error'}) { }
331 0 0 if (my $error_msg = $opt->validate($$res{'opt'}))
338 0 0 if (my $error_msg = $arg->parse($parsed_args, $$res{'arg'}))
343 0 5 if @$parsed_args
348 0 5 if ($class->can('CLI_VALIDATE') and defined(my $error_msg = $class->CLI_VALIDATE($$res{'opt'}, $$res{'arg'}, $$res{'rest'})))
356 0 5 if ($class->can('CLI_RUN')) { }
367 0 5 if ($class->can('CLI') and my $spec = $class->CLI) { }
368 0 0 if (not XXX) { }
0 0 elsif (XXX) { }
375 0 0 if $$spec{'cmd'} and not XXX
377 0 0 if $$spec{'name'} and not XXX
388 0 0 $class ? :
390 0 0 if ($$spec{'name'}) { }
402 0 0 $class ? :
410 0 0 if ($self->is_cmd) { }
414 0 0 if %{$self->opt}
416 0 0 if (@{$self->arg})
435 0 0 if (@$cmd) { }
446 0 0 if ($help)
460 0 0 if ($self->is_cmd) { }
475 0 0 unless %$list
480 0 0 if length $_->[0] > $max_key_len
496 0 0 if $ENV->can_scan_deps
504 0 0 if (my $alias = $self->_help_alias)
508 0 0 if (my $abstract = $self->_help_class_abstract)
512 0 0 if (my $help = $self->_help)
516 0 0 if (my $help_usage = $self->_help_usage)
526 0 0 if ($invalid_options)
536 0 0 if (my $abstract = $self->_help_class_abstract)
540 0 0 if (my $help_usage = $self->_help_usage)
550 0 0 if ($ENV->dist) { }
554 0 0 $main::VERSION ? :
557 0 0 if not $ENV->dist or $ENV->dist->name ne $ENV->pcore->name
561 0 0 if $ENV->is_par
567 0 0 if defined $msg