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