line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/env perl |
2
|
|
|
|
|
|
|
package yto; |
3
|
|
|
|
|
|
|
our $VERSION = '0.035'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Change YAML to another format (like JSON) |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
434
|
use ETL::Yertl; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
256
|
use Pod::Usage::Return qw( pod2usage ); |
|
1
|
|
|
|
|
38861
|
|
|
1
|
|
|
|
|
62
|
|
8
|
1
|
|
|
1
|
|
506
|
use Getopt::Long qw( GetOptionsFromArray ); |
|
1
|
|
|
|
|
7503
|
|
|
1
|
|
|
|
|
5
|
|
9
|
1
|
|
|
1
|
|
448
|
use ETL::Yertl::Command::yto; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
179
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$|++; # no buffering |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub main { |
14
|
4
|
|
|
4
|
|
35234
|
my ( $class, @argv ) = @_; |
15
|
4
|
|
|
|
|
8
|
my %opt; |
16
|
4
|
|
|
|
|
17
|
GetOptionsFromArray( \@argv, \%opt, |
17
|
|
|
|
|
|
|
'help|h', |
18
|
|
|
|
|
|
|
'version', |
19
|
|
|
|
|
|
|
'delimiter|d=s', |
20
|
|
|
|
|
|
|
); |
21
|
4
|
50
|
|
|
|
1070
|
return pod2usage(0) if $opt{help}; |
22
|
4
|
50
|
|
|
|
10
|
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
|
|
|
|
|
25
|
ETL::Yertl::Command::yto->main( @argv, \%opt ); |
29
|
|
|
|
|
|
|
}; |
30
|
4
|
100
|
|
|
|
14
|
if ( $@ ) { |
31
|
2
|
|
|
|
|
8
|
return pod2usage( "ERROR: $@" ); |
32
|
|
|
|
|
|
|
} |
33
|
2
|
|
|
|
|
8
|
return 0; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
exit __PACKAGE__->main( @ARGV ) unless caller(0); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |