line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/env perl |
2
|
|
|
|
|
|
|
package yto; |
3
|
|
|
|
|
|
|
our $VERSION = '0.036'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Change YAML to another format (like JSON) |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
449
|
use ETL::Yertl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
7
|
1
|
|
|
1
|
|
263
|
use Pod::Usage::Return qw( pod2usage ); |
|
1
|
|
|
|
|
39393
|
|
|
1
|
|
|
|
|
74
|
|
8
|
1
|
|
|
1
|
|
592
|
use Getopt::Long qw( GetOptionsFromArray ); |
|
1
|
|
|
|
|
8117
|
|
|
1
|
|
|
|
|
6
|
|
9
|
1
|
|
|
1
|
|
634
|
use ETL::Yertl::Command::yto; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
170
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$|++; # no buffering |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub main { |
14
|
4
|
|
|
4
|
|
37161
|
my ( $class, @argv ) = @_; |
15
|
4
|
|
|
|
|
9
|
my %opt; |
16
|
4
|
|
|
|
|
27
|
GetOptionsFromArray( \@argv, \%opt, |
17
|
|
|
|
|
|
|
'help|h', |
18
|
|
|
|
|
|
|
'version', |
19
|
|
|
|
|
|
|
'delimiter|d=s', |
20
|
|
|
|
|
|
|
); |
21
|
4
|
50
|
|
|
|
1259
|
return pod2usage(0) if $opt{help}; |
22
|
4
|
50
|
|
|
|
15
|
if ( $opt{version} ) { |
23
|
0
|
|
|
|
|
0
|
print "yto version $yto::VERSION (Perl $^V)\n"; |
24
|
0
|
|
|
|
|
0
|
return 0; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
8
|
eval { |
28
|
4
|
|
|
|
|
38
|
ETL::Yertl::Command::yto->main( @argv, \%opt ); |
29
|
|
|
|
|
|
|
}; |
30
|
4
|
100
|
|
|
|
15
|
if ( $@ ) { |
31
|
2
|
|
|
|
|
14
|
return pod2usage( "ERROR: $@" ); |
32
|
|
|
|
|
|
|
} |
33
|
2
|
|
|
|
|
8
|
return 0; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
exit __PACKAGE__->main( @ARGV ) unless caller(0); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |