| 1 | package App::Horris::CLI::Command::run; | ||
| 2 | # ABSTRACT: Horris runner | ||
| 3 | |||
| 4 | |||
| 5 | use Moose; | ||
| 6 | use Horris; | ||
| 7 | use namespace::autoclean; | ||
| 8 | extends 'MooseX::App::Cmd::Command'; | ||
| 9 | with qw/MooseX::SimpleConfig/; | ||
| 10 | |||
| 11 | has '+configfile' => ( | ||
| 12 | default => '/etc/horris.conf' | ||
| 13 | ); | ||
| 14 | |||
| 15 | has config => ( | ||
| 16 | traits => ['NoGetopt'], | ||
| 17 | is => 'ro', | ||
| 18 | isa => 'HashRef', | ||
| 19 | ); | ||
| 20 | |||
| 21 | around _usage_format => sub { | ||
| 22 | return "usage: %c %o (run 'perldoc " . __PACKAGE__ . "' for more info)"; | ||
| 23 | }; | ||
| 24 | |||
| 25 | sub config_any_args { | ||
| 26 | return { | ||
| 27 | driver_args => { | ||
| 28 | General => { | ||
| 29 | -LowerCaseNames => 1, | ||
| 30 | } | ||
| 31 | } | ||
| 32 | }; | ||
| 33 | } | ||
| 34 | |||
| 35 | sub execute { | ||
| 36 | my ( $self, $opt, $args ) = @_; | ||
| 37 | my $horris = Horris->new(config => $self->config); | ||
| 38 | $horris->run; | ||
| 39 | } | ||
| 40 | |||
| 41 | 1; | ||
| 42 | |||
| 43 | __END__ |