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