Branch Coverage

blib/lib/CLI/Helpers.pm
Criterion Covered Total %
branch 63 172 36.6


line true false branch
59 1 2 if ($arg eq 'delay_argv') { }
0 2 elsif ($arg eq 'preprocess_argv') { }
0 2 elsif ($arg eq 'copy_argv') { }
81 0 1 if $_init_complete++
82 0 1 if $ARGV_AT_INIT
112 5 2 if (defined $opt_ref and XXX) { }
114 0 5 $COPY_ARGV ? :
118 1 1 if ($parsed_argv) { }
128 0 2 $COPY_ARGV ? :
139 0 0 unless open $DATA_HANDLE, '>', $data_file
141 0 0 unless (eval { do { die "data file unwritable: $!" unless open $DATA_HANDLE, '>', $data_file; 1 } })
160 0 7 if $opts->{'data-file'}
176 0 7 exists $opts->{'syslog-tag'} && length $opts->{'syslog-tag'} ? :
0 7 exists $opts->{'syslog-facility'} && length $opts->{'syslog-facility'} ? :
0 7 $opts->{'tags'} ? :
184 0 7 if ($DEF{'SYSLOG'})
188 0 0 unless (eval { do { openlog($DEF{'SYSLOG_TAG'}, 'ndelay,pid', $DEF{'SYSLOG_FACILITY'}); 1 } })
196 0 7 if ($DEF{'NOPASTE'})
200 0 0 unless (eval { do { &load('App::Nopaste'); 1 } })
215 0 1 if (keys %TAGS)
222 0 1 if (@STICKY)
228 0 1 if (@NOPASTE)
233 0 0 $ENV{'NOPASTE_SERVICES'} ? :
0 0 $DEF{'NOPASTE_SERVICE'} ? :
240 0 0 $DEF{'NOPASTE_PUBLIC'} ? :
243 0 0 if ($services) { }
255 0 1 if $DEF{'SYSLOG'}
259 2 0 exists $DEF{$_[0]} ? :
267 7 0 if ($rc != 0)
272 0 0 if ($stdout =~ /auto/ or $stdout =~ /true/)
282 0 0 if (defined $color and $DEF{'COLOR'})
290 11 5 XXX ? :
293 0 16 unless @_
296 0 16 unless keys %DEF
299 16 0 if defined $x
303 0 16 exists $opts->{'color'} && defined $opts->{'color'} ? :
306 0 16 exists $opts->{'indent'} ? :
309 0 0 if ($DEF{'TAGS'} and exists $opts->{'tag'})
313 0 0 unless $DEF{'TAGS'}{$opts->{'tag'}}
317 0 16 scalar(@input) % 2 == 0 && (exists $opts->{'kv'} && $opts->{'kv'} == 1) ? :
319 0 16 if ($DO_KV) { }
324 0 0 $DEF{'KV_FORMAT'} eq ': ' ? :
329 0 16 defined $color ? :
333 16 0 if (not $DEF{'QUIET'} or $opts->{'IMPORTANT'})
334 5 11 $opts->{'stderr'} ? :
336 0 16 if exists $opts->{'clear'}
342 0 16 if (defined $DATA_HANDLE and $opts->{'data'}) { }
0 32 elsif ($DEF{'SYSLOG'} and not $opts->{'no_syslog'}) { }
347 0 0 exists $opts->{'stderr'} ? :
0 0 exists $opts->{'syslog_level'} ? :
352 0 0 if $opts->{'data'}
361 0 0 unless (eval { do { syslog($level, colorstrip($_)); 1 } })
370 0 16 if (exists $opts->{'sticky'})
377 0 16 if ($DEF{'NOPASTE'})
384 5 5 XXX ? :
385 5 5 unless exists $opts->{'level'}
386 5 5 $opts->{'level'} > 1 ? :
390 0 10 unless keys %DEF
392 8 2 unless ($DEF{'DEBUG'})
393 5 3 unless $DEF{'VERBOSE'} >= $opts->{'level'}
400 7 19 XXX ? :
404 0 26 unless keys %DEF
407 22 4 unless $DEF{'DEBUG'}
410 1 3 exists $opts->{'_caller_package'} ? :
411 3 1 unless lc $DEF{'DEBUG_CLASS'} eq 'all' or $package eq $DEF{'DEBUG_CLASS'}
429 0 7 if (XXX and defined $_[1] and XXX)
443 0 0 unless exists $_allow_override{lc $var}
461 0 0 if defined $answer
474 0 0 $question =~ s/([^a-zA-Z0-9\)\]\}])\s*$// ? :
475 0 0 if (exists $args{'default'})
485 0 0 exists $args{'validate'} ? :
490 0 0 if defined $error
494 0 0 if (exists $args{'noecho'}) { }
506 0 0 if $text =~ /\S/
510 0 0 if (exists $args{'default'} and length $text == 0)
515 0 0 if ($validate->{$v}->() > 0)
535 0 0 if (XXX) { }
0 0 elsif (XXX) { }
552 0 0 if defined $choice
558 0 0 if $choice =~ /\S/
568 0 0 if (my $validate = $args{'validate'})
573 0 0 if defined $_
584 0 0 if exists $args{'yn'}
585 0 0 if exists $args{'menu'}
587 0 0 if (lc($prompt) =~ /passw(or)?d/)
590 0 0 if defined $_