line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Term::Choose_HAE; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
133277
|
use warnings; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
62
|
|
4
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
37
|
|
5
|
2
|
|
|
2
|
|
49
|
use 5.010001; |
|
2
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.058'; |
8
|
2
|
|
|
2
|
|
12
|
use Exporter 'import'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
95
|
|
9
|
|
|
|
|
|
|
our @EXPORT_OK = qw( choose ); |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
19
|
use Carp qw( croak ); |
|
2
|
|
|
|
|
45
|
|
|
2
|
|
|
|
|
121
|
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
1232
|
use if $^O eq 'MSWin32', 'Win32::Console::ANSI'; |
|
2
|
|
|
|
|
27
|
|
|
2
|
|
|
|
|
10
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
844
|
use parent 'Term::Choose'; |
|
2
|
|
|
|
|
563
|
|
|
2
|
|
|
|
|
28
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
my $Plugin; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
BEGIN { |
21
|
2
|
50
|
|
2
|
|
77712
|
if ( $^O eq 'MSWin32' ) { |
22
|
0
|
|
|
|
|
0
|
require Term::Choose::Win32; |
23
|
0
|
|
|
|
|
0
|
$Plugin = 'Term::Choose::Win32'; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
else { |
26
|
2
|
|
|
|
|
15
|
require Term::Choose::Linux; |
27
|
2
|
|
|
|
|
527
|
$Plugin = 'Term::Choose::Linux'; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub new { |
33
|
|
|
|
|
|
|
# the function 'choose' uses its own implicit new |
34
|
112
|
|
|
112
|
1
|
40529
|
my $class = shift; |
35
|
112
|
|
|
|
|
208
|
my ( $opt ) = @_; |
36
|
112
|
50
|
|
|
|
267
|
croak "new: called with " . @_ . " arguments - 0 or 1 arguments expected" if @_ > 1; |
37
|
112
|
|
|
|
|
196
|
my $self = bless {}, $class; |
38
|
112
|
100
|
|
|
|
246
|
if ( defined $opt ) { |
39
|
111
|
50
|
|
|
|
273
|
croak "new: the (optional) argument must be a HASH reference" if ref $opt ne 'HASH'; |
40
|
111
|
|
|
|
|
294
|
$self->__validate_and_add_options( $opt ); |
41
|
|
|
|
|
|
|
} |
42
|
112
|
50
|
|
|
|
6049
|
if ( $opt->{fill_up} ) { |
43
|
0
|
|
|
|
|
0
|
$opt->{color} = 1 + delete $opt->{fill_up}; |
44
|
|
|
|
|
|
|
} |
45
|
112
|
50
|
|
|
|
403
|
$self->{backup_opt} = { defined $opt ? %$opt : () }; |
46
|
112
|
|
|
|
|
350
|
$self->{plugin} = $Plugin->new(); |
47
|
112
|
|
|
|
|
727
|
return $self; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub choose { |
52
|
0
|
0
|
|
0
|
1
|
|
if ( ref $_[0] ne 'Term::Choose_HAE' ) { |
53
|
0
|
0
|
|
|
|
|
if ( $_[1]->{fill_up} ) { |
54
|
0
|
|
|
|
|
|
$_[1]->{color} = 1 + delete $_[1]->{fill_up}; |
55
|
|
|
|
|
|
|
} |
56
|
0
|
|
|
|
|
|
return Term::Choose_HAE->new()->Term::Choose::__choose( @_ ); |
57
|
|
|
|
|
|
|
} |
58
|
0
|
|
|
|
|
|
my $self = shift; |
59
|
0
|
0
|
|
|
|
|
if ( $_[1]->{fill_up} ) { |
60
|
0
|
|
|
|
|
|
$_[1]->{color} = 1 + delete $_[1]->{fill_up}; |
61
|
|
|
|
|
|
|
} |
62
|
0
|
|
|
|
|
|
return $self->Term::Choose::__choose( @_ ); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |