line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sys::Bprsync::Cmd::Command; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Sys::Bprsync::Cmd::Command::VERSION = '0.25'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
1
|
|
|
1
|
|
3337
|
$Sys::Bprsync::Cmd::Command::AUTHORITY = 'cpan:TEX'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: baseclass for any bprsync CLI command |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
31
|
use 5.010_000; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
49
|
|
11
|
1
|
|
|
1
|
|
7
|
use mro 'c3'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
24
|
|
12
|
1
|
|
|
1
|
|
38
|
use feature ':5.10'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
134
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
602
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use namespace::autoclean; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# use IO::Handle; |
18
|
|
|
|
|
|
|
# use autodie; |
19
|
|
|
|
|
|
|
# use MooseX::Params::Validate; |
20
|
|
|
|
|
|
|
# use Carp; |
21
|
|
|
|
|
|
|
# use English qw( -no_match_vars ); |
22
|
|
|
|
|
|
|
# use Try::Tiny; |
23
|
|
|
|
|
|
|
use Config::Yak; |
24
|
|
|
|
|
|
|
use Log::Tree; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# extends ... |
27
|
|
|
|
|
|
|
extends 'MooseX::App::Cmd::Command'; |
28
|
|
|
|
|
|
|
# has ... |
29
|
|
|
|
|
|
|
has '_config' => ( |
30
|
|
|
|
|
|
|
'is' => 'rw', |
31
|
|
|
|
|
|
|
'isa' => 'Config::Yak', |
32
|
|
|
|
|
|
|
'lazy' => 1, |
33
|
|
|
|
|
|
|
'builder' => '_init_config', |
34
|
|
|
|
|
|
|
'accessor' => 'config', |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has '_logger' => ( |
38
|
|
|
|
|
|
|
'is' => 'rw', |
39
|
|
|
|
|
|
|
'isa' => 'Log::Tree', |
40
|
|
|
|
|
|
|
'lazy' => 1, |
41
|
|
|
|
|
|
|
'builder' => '_init_logger', |
42
|
|
|
|
|
|
|
'accessor' => 'logger', |
43
|
|
|
|
|
|
|
); |
44
|
|
|
|
|
|
|
# with ... |
45
|
|
|
|
|
|
|
# initializers ... |
46
|
|
|
|
|
|
|
sub _init_config { |
47
|
|
|
|
|
|
|
my $self = shift; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $Config = Config::Yak::->new({ |
50
|
|
|
|
|
|
|
'locations' => [qw(conf /etc/bprsync)], |
51
|
|
|
|
|
|
|
}); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
return $Config; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _init_logger { |
57
|
|
|
|
|
|
|
my $self = shift; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
my $Logger = Log::Tree::->new('bprsync'); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
return $Logger; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# your code here ... |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
no Moose; |
67
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=pod |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=encoding UTF-8 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 NAME |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Sys::Bprsync::Cmd::Command - baseclass for any bprsync CLI command |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 NAME |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Sys::RevoBackup::Cmd::Command - Base class for any bprsync command. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 AUTHOR |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Dominik Schulz <dominik.schulz@gauner.org> |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Dominik Schulz. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
94
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |