| 1 | package Getopt::Yath::Option::Bool; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $VERSION = '2.000007'; | |||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use parent 'Getopt::Yath::Option'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use Getopt::Yath::HashBase; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 3 | ▶ | sub allows_shortval { 0 } | ||||||||
|
Subroutine
allows_shortval: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 11 | 1 | ▶ | sub allows_default { 1 } | ||||||||
|
Subroutine
allows_default: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 12 | 9 | ▶ | sub allows_arg { 0 } | ||||||||
|
Subroutine
allows_arg: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 13 | 6 | ▶ | sub requires_arg { 0 } | ||||||||
|
Subroutine
requires_arg: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 14 | 6 | ▶ | sub allows_autofill { 0 } | ||||||||
|
Subroutine
allows_autofill: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 15 | 4 | ▶ | sub requires_autofill { 0 } | ||||||||
|
Subroutine
requires_autofill: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | |||||||||||
| 17 | 6 | ▶ | sub no_arg_value { 1 } # --bool | ||||||||
|
Subroutine
no_arg_value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 18 | |||||||||||
| 19 | # undef is not populated, otherwise qw have 1 or 0 | ||||||||||
| 20 | 162 | ▶ | sub is_populated { defined(${$_[1]}) ? 1 : 0 } | ||||||||
|
Subroutine
is_populated: called CC=2 SCAR=6.9
Pod
undocumented
Branch: 1 branch
| |||||||||||
| 21 | |||||||||||
| 22 | 337 | ▶ | sub add_value { ${$_[1]} = $_[2] } | ||||||||
|
Subroutine
add_value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 23 | 3 | ▶ | sub clear_field { ${$_[1]} = 0 } # --no-bool | ||||||||
|
Subroutine
clear_field: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 24 | |||||||||||
| 25 | # Default to 0 unless otherwise specified | ||||||||||
| 26 | sub get_default_value { | ||||||||||
| 27 | 156 | ▶ | my $self = shift; | ||||||||
|
Subroutine
get_default_value: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||
| 28 | 156 | ▶ | return undef if $self->{+MAYBE}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 156 | ▶ | return $self->SUPER::get_default_value(@_) ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 165 | ▶ | sub can_set_env { 1 } | ||||||||
|
Subroutine
can_set_env: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 33 | |||||||||||
| 34 | sub get_env_value { | ||||||||||
| 35 | 0 | ▶ | my $opt = shift; | ||||||||
|
Subroutine
get_env_value: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 36 | 0 | my ($var, $ref) = @_; | |||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | my $b = $$ref ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 0 | ▶ | return $b unless $var =~ m/^!/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 0 | ▶ | return $b ? 0 : 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 1 | 1; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||