line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::CmdDispatch::IO; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
48
|
use warnings; |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
287
|
|
4
|
11
|
|
|
11
|
|
49
|
use strict; |
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
196
|
|
5
|
11
|
|
|
11
|
|
47
|
use Term::ReadLine; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
3399
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.43'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $term; |
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
4
|
|
|
4
|
1
|
7
|
my $class = shift; |
13
|
4
|
|
66
|
|
|
30
|
$term ||= Term::ReadLine->new('CmdDispatch Shell'); |
14
|
4
|
|
|
|
|
298615
|
$term->ornaments( 0 ); |
15
|
4
|
|
|
|
|
211
|
return bless { term => $term }, $class; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub print |
19
|
|
|
|
|
|
|
{ |
20
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
21
|
0
|
|
|
|
|
|
return CORE::print @_; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub readline |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
27
|
0
|
|
|
|
|
|
return $self->{term}->readline( '' ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub prompt |
31
|
|
|
|
|
|
|
{ |
32
|
0
|
|
|
0
|
1
|
|
my ($self, @in) = @_; |
33
|
0
|
|
|
|
|
|
return $self->{term}->readline( @in ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
{ |
37
|
|
|
|
|
|
|
package App::CmdDispatch::MinimalIO; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub new |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
|
|
my $class = @_; |
42
|
0
|
|
|
|
|
|
return bless {}, $class; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub print |
46
|
|
|
|
|
|
|
{ |
47
|
0
|
|
|
0
|
|
|
my $self = shift; |
48
|
0
|
|
|
|
|
|
return CORE::print @_; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub readline |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
54
|
0
|
|
|
|
|
|
return CORE::readline; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub prompt |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
0
|
|
|
my ($self, @in) = @_; |
60
|
0
|
|
|
|
|
|
$self->print( @in ); |
61
|
0
|
|
|
|
|
|
return $self->readline(); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
__END__ |