line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Cmd::repl; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
16161
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
82373
|
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
806
|
use parent 'Catmandu::Cmd'; |
|
1
|
|
|
|
|
255
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
5107
|
use Devel::REPL; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Catmandu::Cmd::repl - interactive shell for Catmandu |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 0.01 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
catmandu repl |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub command_opt_spec { |
26
|
|
|
|
|
|
|
(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub command { |
30
|
|
|
|
|
|
|
my ($self, $opts, $args) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my @plugins = qw(LexEnv DDC Packages Commands MultiLine::PPI Colors); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $init = <<PERL; |
35
|
|
|
|
|
|
|
use Catmandu::Sane; |
36
|
|
|
|
|
|
|
use Catmandu qw(:all); |
37
|
|
|
|
|
|
|
PERL |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $repl = Devel::REPL->new; |
40
|
|
|
|
|
|
|
$repl->load_plugin($_) for @plugins; |
41
|
|
|
|
|
|
|
$repl->current_package('main'); |
42
|
|
|
|
|
|
|
$repl->eval($init); |
43
|
|
|
|
|
|
|
$repl->run; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 AUTHOR |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Nicolas Steenlant, C<< <nicolas.steenlant at ugent.be> >> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Copyright 2012 Ghent University Library |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
55
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
56
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |