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         1  
  1         88  
3 1     1   6 use warnings;
  1         2  
  1         67  
4              
5             our $VERSION = '2.000008';
6              
7 1     1   4 use parent 'Getopt::Yath::Option';
  1         2  
  1         7  
8 1     1   51 use Getopt::Yath::HashBase;
  1         2  
  1         5  
9              
10 1     1 0 3 sub allows_default { 1 }
11 16     16 0 35 sub allows_arg { 1 }
12 15     15 0 26 sub requires_arg { 1 }
13 0     0 0 0 sub allows_autofill { 0 }
14 4     4 0 12 sub requires_autofill { 0 }
15              
16 164 100   164 0 161 sub is_populated { defined(${$_[1]}) ? 1 : 0 }
  164         330  
17              
18 306     306 0 316 sub add_value { ${$_[1]} = $_[2] }
  306         472  
19              
20 92     92 0 124 sub can_set_env { 1 }
21              
22             sub get_env_value {
23 9     9 0 10 my $opt = shift;
24 9         12 my ($var, $ref) = @_;
25              
26 9 50       34 return $$ref unless $var =~ m/^!/;
27 0 0         return $ref ? 0 : 1;
28             }
29              
30              
31             1;
32              
33             __END__