| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
|
3
|
14
|
|
|
14
|
|
123346
|
|
|
|
14
|
|
|
|
|
32
|
|
|
|
14
|
|
|
|
|
88
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use parent 'Catmandu::Cmd'; |
|
7
|
14
|
|
|
14
|
|
111
|
use Catmandu::Util::Path qw(as_path); |
|
|
14
|
|
|
|
|
27
|
|
|
|
14
|
|
|
|
|
72
|
|
|
8
|
14
|
|
|
14
|
|
6311
|
use Catmandu; |
|
|
14
|
|
|
|
|
32
|
|
|
|
14
|
|
|
|
|
676
|
|
|
9
|
14
|
|
|
14
|
|
94
|
use namespace::clean; |
|
|
14
|
|
|
|
|
35
|
|
|
|
14
|
|
|
|
|
77
|
|
|
10
|
14
|
|
|
14
|
|
2992
|
|
|
|
14
|
|
|
|
|
28
|
|
|
|
14
|
|
|
|
|
54
|
|
|
11
|
|
|
|
|
|
|
(["fix=s@", ""], ["var=s%", ""], ["preprocess|pp", ""],); |
|
12
|
|
|
|
|
|
|
} |
|
13
|
3
|
|
|
3
|
1
|
34
|
|
|
14
|
|
|
|
|
|
|
my ($self, $opts, $args) = @_; |
|
15
|
|
|
|
|
|
|
my $from; |
|
16
|
|
|
|
|
|
|
my $into; |
|
17
|
3
|
|
|
3
|
1
|
8
|
|
|
18
|
3
|
|
|
|
|
7
|
my ($from_args, $from_opts, $into_args, $into_opts) |
|
19
|
|
|
|
|
|
|
= $self->_parse_options($args); |
|
20
|
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
18
|
if (@$from_args) { |
|
22
|
|
|
|
|
|
|
$from = as_path($from_args->[0])->getter->(Catmandu->config); |
|
23
|
|
|
|
|
|
|
} |
|
24
|
3
|
100
|
|
|
|
10
|
else { |
|
25
|
1
|
|
|
|
|
7
|
$from = Catmandu->config; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
17
|
if (@$into_args || %$into_opts) { |
|
29
|
|
|
|
|
|
|
$into = Catmandu->exporter($into_args->[0], $into_opts); |
|
30
|
|
|
|
|
|
|
} |
|
31
|
3
|
50
|
33
|
|
|
47
|
else { |
|
32
|
3
|
|
|
|
|
21
|
$into = $self->_default_exporter; |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
0
|
if ($opts->fix) { |
|
36
|
|
|
|
|
|
|
$from = $self->_build_fixer($opts)->fix($from); |
|
37
|
|
|
|
|
|
|
} |
|
38
|
3
|
100
|
|
|
|
19
|
|
|
39
|
1
|
|
|
|
|
13
|
$into->add($from); |
|
40
|
|
|
|
|
|
|
$into->commit; |
|
41
|
|
|
|
|
|
|
} |
|
42
|
3
|
|
|
|
|
121
|
|
|
43
|
3
|
|
|
|
|
63
|
Catmandu->exporter('JSON', pretty => 1, array => 0); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
|
47
|
0
|
|
|
0
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=pod |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Catmandu::Cmd::config - export the Catmandu config |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 EXAMPLES |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# export config to JSON |
|
58
|
|
|
|
|
|
|
catmandu config |
|
59
|
|
|
|
|
|
|
# or any other Catmandu::Exporter |
|
60
|
|
|
|
|
|
|
catmandu config to YAML --fix 'delete_field(password)' |
|
61
|
|
|
|
|
|
|
# export only part of the config file |
|
62
|
|
|
|
|
|
|
catmandu config my.prefix to CSV |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |