line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::CmdDispatch::IO; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
75
|
use warnings; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
360
|
|
4
|
11
|
|
|
11
|
|
57
|
use strict; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
215
|
|
5
|
11
|
|
|
11
|
|
51
|
use Term::ReadLine; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
3649
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.44'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $term; |
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
4
|
|
|
4
|
1
|
7
|
my ($class) = @_; |
13
|
4
|
|
66
|
|
|
24
|
$term ||= Term::ReadLine->new('CmdDispatch Shell'); |
14
|
4
|
|
|
|
|
10988
|
$term->ornaments( 0 ); |
15
|
4
|
|
|
|
|
191
|
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__ |