Branch Coverage

blib/lib/CLI/Helpers.pm
Criterion Covered Total %
branch 63 176 35.8


line true false branch
54 1 2 if ($arg eq 'delay_argv') { }
0 2 elsif ($arg eq 'preprocess_argv') { }
0 2 elsif ($arg eq 'copy_argv') { }
76 0 1 if $_init_complete++
77 0 1 if $ARGV_AT_INIT
107 5 2 if (defined $opt_ref and XXX) { }
109 0 5 $COPY_ARGV ? :
113 1 1 if ($parsed_argv) { }
123 0 2 $COPY_ARGV ? :
134 0 0 unless open $DATA_HANDLE, ">", $data_file
136 0 0 unless (eval {
155 0 7 if $opts->{'data-file'}
171 0 7 exists $opts->{'syslog-tag'} && length $opts->{'syslog-tag'} ? :
0 7 exists $opts->{'syslog-facility'} && length $opts->{'syslog-facility'} ? :
0 7 $opts->{'tags'} ? :
179 0 7 if ($DEF{'SYSLOG'})
183 0 0 unless (eval {
191 0 7 if ($DEF{'NOPASTE'})
195 0 0 unless (eval {
210 0 1 if (keys %TAGS)
217 0 1 if (@STICKY)
223 0 1 if (@NOPASTE)
228 0 0 $ENV{'NOPASTE_SERVICES'} ? :
0 0 $DEF{'NOPASTE_SERVICE'} ? :
235 0 0 $DEF{'NOPASTE_PUBLIC'} ? :
238 0 0 if ($services) { }
250 0 1 if $DEF{'SYSLOG'}
254 2 0 exists $DEF{$_[0]} ? :
258 7 0 unless is_interactive()
264 0 0 if ($rc != 0)
269 0 0 if ($stdout =~ /auto/ or $stdout =~ /true/)
280 0 0 if (defined $color and $DEF{'COLOR'})
288 11 5 XXX ? :
291 0 16 unless @_
294 0 16 unless keys %DEF
297 16 0 if defined $x
301 0 16 exists $opts->{'color'} && defined $opts->{'color'} ? :
304 0 16 exists $opts->{'indent'} ? :
307 0 0 if ($DEF{'TAGS'} and exists $opts->{'tag'})
311 0 0 unless $DEF{'TAGS'}{$opts->{'tag'}}
315 0 16 scalar(@input) % 2 == 0 && (exists $opts->{'kv'} && $opts->{'kv'} == 1) ? :
317 0 16 if ($DO_KV) { }
322 0 0 $DEF{'KV_FORMAT'} eq ': ' ? :
327 0 16 defined $color ? :
331 16 0 if (not $DEF{'QUIET'} or $opts->{'IMPORTANT'})
332 5 11 $opts->{'stderr'} ? :
334 0 16 if exists $opts->{'clear'}
340 0 16 if (defined $DATA_HANDLE and $opts->{'data'}) { }
0 32 elsif ($DEF{'SYSLOG'} and not $opts->{'no_syslog'}) { }
345 0 0 exists $opts->{'stderr'} ? :
0 0 exists $opts->{'syslog_level'} ? :
350 0 0 if $opts->{'data'}
359 0 0 unless (eval {
368 0 16 if (exists $opts->{'sticky'})
375 0 16 if ($DEF{'NOPASTE'})
382 5 5 XXX ? :
383 5 5 unless exists $opts->{'level'}
384 5 5 $opts->{'level'} > 1 ? :
388 0 10 unless keys %DEF
390 8 2 unless ($DEF{'DEBUG'})
391 5 3 unless $DEF{'VERBOSE'} >= $opts->{'level'}
398 7 12 XXX ? :
402 0 19 unless keys %DEF
405 16 3 unless $DEF{'DEBUG'}
408 1 2 exists $opts->{'_caller_package'} ? :
409 2 1 unless lc $DEF{'DEBUG_CLASS'} eq "all" or $package eq $DEF{'DEBUG_CLASS'}
427 0 7 if (XXX and defined $_[1] and XXX)
441 0 0 unless exists $_allow_override{lc $var}
458 0 0 if defined $answer
471 0 0 $question =~ s/([^a-zA-Z0-9\)\]\}])\s*$// ? :
472 0 0 if (exists $args{'default'})
479 0 0 exists $args{'validate'} ? :
484 0 0 if defined $error
491 0 0 if (exists $args{'default'} and length $text == 0)
496 0 0 if ($validate->{$v}->() > 0)
513 0 0 if (XXX) { }
0 0 elsif (XXX) { }
529 0 0 if defined $choice
544 0 0 if (my $validate = $args{'validate'})
549 0 0 if defined $_
560 0 0 if exists $args{'yn'}
561 0 0 if exists $args{'menu'}
563 0 0 if (lc($prompt) =~ /passw(or)?d/)
566 0 0 if defined $_
578 0 0 if ($interactive) { }
582 0 0 if (exists $args->{'noecho'}) { }
584 0 0 if ($attrs->{'shadow_redisplay'}) { }
603 0 0 if length $text and $text =~ /\S/