line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
14
|
|
|
14
|
|
128876
|
|
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
79
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use parent 'Catmandu::Cmd'; |
7
|
14
|
|
|
14
|
|
101
|
use Catmandu::Util::Path qw(as_path); |
|
14
|
|
|
|
|
27
|
|
|
14
|
|
|
|
|
69
|
|
8
|
14
|
|
|
14
|
|
6092
|
use Catmandu; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
655
|
|
9
|
14
|
|
|
14
|
|
92
|
use namespace::clean; |
|
14
|
|
|
|
|
31
|
|
|
14
|
|
|
|
|
72
|
|
10
|
14
|
|
|
14
|
|
2747
|
|
|
14
|
|
|
|
|
28
|
|
|
14
|
|
|
|
|
49
|
|
11
|
|
|
|
|
|
|
(["fix=s@", ""], ["var=s%", ""], ["preprocess|pp", ""],); |
12
|
|
|
|
|
|
|
} |
13
|
3
|
|
|
3
|
1
|
24
|
|
14
|
|
|
|
|
|
|
my ($self, $opts, $args) = @_; |
15
|
|
|
|
|
|
|
my $from; |
16
|
|
|
|
|
|
|
my $into; |
17
|
3
|
|
|
3
|
1
|
5
|
|
18
|
3
|
|
|
|
|
6
|
my ($from_args, $from_opts, $into_args, $into_opts) |
19
|
|
|
|
|
|
|
= $self->_parse_options($args); |
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
12
|
if (@$from_args) { |
22
|
|
|
|
|
|
|
$from = as_path($from_args->[0])->getter->(Catmandu->config); |
23
|
|
|
|
|
|
|
} |
24
|
3
|
100
|
|
|
|
10
|
else { |
25
|
1
|
|
|
|
|
5
|
$from = Catmandu->config; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
10
|
if (@$into_args || %$into_opts) { |
29
|
|
|
|
|
|
|
$into = Catmandu->exporter($into_args->[0], $into_opts); |
30
|
|
|
|
|
|
|
} |
31
|
3
|
50
|
33
|
|
|
26
|
else { |
32
|
3
|
|
|
|
|
13
|
$into = $self->_default_exporter; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
0
|
if ($opts->fix) { |
36
|
|
|
|
|
|
|
$from = $self->_build_fixer($opts)->fix($from); |
37
|
|
|
|
|
|
|
} |
38
|
3
|
100
|
|
|
|
14
|
|
39
|
1
|
|
|
|
|
25
|
$into->add($from); |
40
|
|
|
|
|
|
|
$into->commit; |
41
|
|
|
|
|
|
|
} |
42
|
3
|
|
|
|
|
104
|
|
43
|
3
|
|
|
|
|
55
|
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 |