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