line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/env perl |
2
|
|
|
|
|
|
|
package ygrok; |
3
|
|
|
|
|
|
|
our $VERSION = '0.035'; |
4
|
|
|
|
|
|
|
# ABSTRACT: Build YAML by parsing lines of plain text |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
475
|
use ETL::Yertl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
7
|
1
|
|
|
1
|
|
284
|
use Pod::Usage::Return qw( pod2usage ); |
|
1
|
|
|
|
|
40067
|
|
|
1
|
|
|
|
|
72
|
|
8
|
1
|
|
|
1
|
|
554
|
use Getopt::Long qw( GetOptionsFromArray :config pass_through ); |
|
1
|
|
|
|
|
7676
|
|
|
1
|
|
|
|
|
5
|
|
9
|
1
|
|
|
1
|
|
631
|
use ETL::Yertl::Command::ygrok; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
201
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$|++; # no buffering |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub main { |
14
|
5
|
|
|
5
|
|
67518
|
my ( $class, @argv ) = @_; |
15
|
5
|
|
|
|
|
14
|
my %opt; |
16
|
5
|
|
|
|
|
59
|
GetOptionsFromArray( \@argv, \%opt, |
17
|
|
|
|
|
|
|
'loose|l', |
18
|
|
|
|
|
|
|
'help|h', |
19
|
|
|
|
|
|
|
'version', |
20
|
|
|
|
|
|
|
); |
21
|
5
|
50
|
|
|
|
1665
|
return pod2usage(0) if $opt{help}; |
22
|
5
|
50
|
|
|
|
22
|
if ( $opt{version} ) { |
23
|
0
|
|
|
|
|
0
|
print "ygrok version $ygrok::VERSION (Perl $^V)\n"; |
24
|
0
|
|
|
|
|
0
|
return 0; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
22
|
eval { |
28
|
5
|
|
|
|
|
52
|
ETL::Yertl::Command::ygrok->main( @argv, \%opt ); |
29
|
|
|
|
|
|
|
}; |
30
|
5
|
100
|
|
|
|
21
|
if ( $@ ) { |
31
|
1
|
|
|
|
|
6
|
return pod2usage( "ERROR: $@" ); |
32
|
|
|
|
|
|
|
} |
33
|
4
|
|
|
|
|
19
|
return 0; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
exit __PACKAGE__->main( @ARGV ) unless caller(0); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |