line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sys::RevoBackup::Cmd::Command; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Sys::RevoBackup::Cmd::Command::VERSION = '0.27'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
BEGIN { |
6
|
1
|
|
|
1
|
|
2257
|
$Sys::RevoBackup::Cmd::Command::AUTHORITY = 'cpan:TEX'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: revobackup CLI baseclass for any command |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
24
|
use 5.010_000; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
11
|
1
|
|
|
1
|
|
6
|
use mro 'c3'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
12
|
1
|
|
|
1
|
|
26
|
use feature ':5.10'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
92
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
560
|
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/revobackup)], |
51
|
|
|
|
|
|
|
}); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
return $Config; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _init_logger { |
57
|
|
|
|
|
|
|
my $self = shift; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
my $Logger = Log::Tree::->new('revobackup'); |
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::RevoBackup::Cmd::Command - revobackup CLI baseclass for any command |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 NAME |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Sys::RevoBackup::Cmd::Command - Base class for any revobackup 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 |