move the --config option to be global, also add a command to unsubscribe a
[p5sagit/Promulger.git] / lib / App / Promulger / Command.pm
CommitLineData
f5baca29 1package App::Promulger::Command;
2use strict;
3use warnings;
4
21baaef0 5use App::Cmd::Setup -command;
6
7use Promulger::Config;
8
21baaef0 9sub validate_args {
10 my ($self, $opt, $args) = @_;
7e9dc6a6 11 my $cf = $self->app->global_options->{config};
21baaef0 12
13 unless(-e $cf) {
14 die "Config file $cf doesn't exist\n";
15 }
16 unless(-f $cf) {
17 die "Config file $cf not a file\n";
18 }
19 unless(-r $cf) {
20 die "Config file $cf not readable\n";
21 }
22
9bfd7b60 23 Promulger::Config->load_config($cf);
21baaef0 24}
f5baca29 25
261;