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