package Sys::Bprsync::Cmd::Command; { $Sys::Bprsync::Cmd::Command::VERSION = '0.17'; } BEGIN { $Sys::Bprsync::Cmd::Command::AUTHORITY = 'cpan:TEX'; } # ABSTRACT: baseclass for any bprsync CLI command use 5.010_000; use mro 'c3'; use feature ':5.10'; use Moose; use namespace::autoclean; # use IO::Handle; # use autodie; # use MooseX::Params::Validate; # use Carp; # use English qw( -no_match_vars ); # use Try::Tiny; use Config::Yak; use Log::Tree; # extends ... extends 'MooseX::App::Cmd::Command'; # has ... has '_config' => ( 'is' => 'rw', 'isa' => 'Config::Yak', 'lazy' => 1, 'builder' => '_init_config', 'accessor' => 'config', ); has '_logger' => ( 'is' => 'rw', 'isa' => 'Log::Tree', 'lazy' => 1, 'builder' => '_init_logger', 'accessor' => 'logger', ); # with ... # initializers ... sub _init_config { my $self = shift; my $Config = Config::Yak::->new({ 'locations' => [qw(conf /etc/bprsync)], }); return $Config; } sub _init_logger { my $self = shift; my $Logger = Log::Tree::->new('bprsync'); return $Logger; } # your code here ... no Moose; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding utf-8 =head1 NAME Sys::Bprsync::Cmd::Command - baseclass for any bprsync CLI command =head1 NAME Sys::RevoBackup::Cmd::Command - Base class for any bprsync command. =head1 AUTHOR Dominik Schulz =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2012 by Dominik Schulz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut