File Coverage

blib/lib/Getopt/Yath/Option/Scalar.pm
Criterion Covered Total %
statement 24 26 92.3
branch 3 6 50.0
condition n/a
subroutine 12 13 92.3
pod 0 9 0.0
total 39 54 72.2


line stmt bran cond sub pod time code
1             package Getopt::Yath::Option::Scalar;
2 1     1   6 use strict;
  1         2  
  1         33  
3 1     1   69 use warnings;
  1         3  
  1         72  
4              
5             our $VERSION = '2.000007';
6              
7 1     1   6 use parent 'Getopt::Yath::Option';
  1         1  
  1         6  
8 1     1   52 use Getopt::Yath::HashBase;
  1         2  
  1         6  
9              
10 1     1 0 4 sub allows_default { 1 }
11 16     16 0 40 sub allows_arg { 1 }
12 15     15 0 36 sub requires_arg { 1 }
13 0     0 0 0 sub allows_autofill { 0 }
14 4     4 0 15 sub requires_autofill { 0 }
15              
16 164 100   164 0 211 sub is_populated { defined(${$_[1]}) ? 1 : 0 }
  164         383  
17              
18 306     306 0 368 sub add_value { ${$_[1]} = $_[2] }
  306         584  
19              
20 92     92 0 166 sub can_set_env { 1 }
21              
22             sub get_env_value {
23 9     9 0 12 my $opt = shift;
24 9         20 my ($var, $ref) = @_;
25              
26 9 50       48 return $$ref unless $var =~ m/^!/;
27 0 0         return $ref ? 0 : 1;
28             }
29              
30              
31             1;
32              
33             __END__