line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Saftpresse::App; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
672
|
use Moose; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: commandline interface extension for Log::Saftpresse |
6
|
|
|
|
|
|
|
our $VERSION = '1.4'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'Log::Saftpresse'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
4348
|
use Getopt::Long; |
|
1
|
|
|
|
|
6615
|
|
|
1
|
|
|
|
|
3
|
|
11
|
1
|
|
|
1
|
|
98
|
use Log::Saftpresse::Log4perl; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
198
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub print_usage { |
14
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
print " usage: $0 |
16
|
|
|
|
|
|
|
[--config|-c <file>] |
17
|
|
|
|
|
|
|
[--log-level|-l <level>] |
18
|
|
|
|
|
|
|
[--help|-h] |
19
|
|
|
|
|
|
|
\n"; |
20
|
0
|
|
|
|
|
|
exit 0; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has 'options' => ( |
24
|
|
|
|
|
|
|
is => 'rw', isa => 'HashRef', |
25
|
|
|
|
|
|
|
default => sub { |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
my %opts; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
GetOptions( |
30
|
|
|
|
|
|
|
"help|h" => \$opts{'help'}, |
31
|
|
|
|
|
|
|
"config|c=s" => \$opts{'config'}, |
32
|
|
|
|
|
|
|
"log-level|l=i" => \$opts{'log_level'}, |
33
|
|
|
|
|
|
|
) or $self->print_usage; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
if( $opts{'help'} ) { |
36
|
|
|
|
|
|
|
$self->print_usage; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return \%opts; |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub init_with_options { |
44
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
0
|
0
|
|
|
|
|
if( $self->options->{'config'} ) { |
47
|
0
|
|
|
|
|
|
$self->load_config( $self->options->{'config'} ); |
48
|
|
|
|
|
|
|
} |
49
|
0
|
|
|
|
|
|
$self->init; |
50
|
0
|
0
|
|
|
|
|
if( defined $self->options->{'log_level'} ) { |
51
|
0
|
|
|
|
|
|
Log::Saftpresse::Log4perl->level( $self->options->{'log_level'} ); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
return; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=encoding UTF-8 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 NAME |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Log::Saftpresse::App - commandline interface extension for Log::Saftpresse |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 VERSION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
version 1.4 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Markus Benning <ich@markusbenning.de> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This software is Copyright (c) 1998 by James S. Seymour, 2015 by Markus Benning. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This is free software, licensed under: |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |