summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-06-26 14:38:42 -0400
committerJesse Luehrs <doy@tozt.net>2013-06-26 14:42:44 -0400
commitc18f54da211be1bd0f77d9d311b97a58e7ebb23e (patch)
treee2c5cb5cc954f937b27934c1b7fb4ed4ab3e3eb3
parent183d572bca16d18687debb608d71fe77f021fe16 (diff)
downloadreply-c18f54da211be1bd0f77d9d311b97a58e7ebb23e.tar.gz
reply-c18f54da211be1bd0f77d9d311b97a58e7ebb23e.zip
add a few more command line options (RT86341)
-rw-r--r--lib/Reply/App.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Reply/App.pm b/lib/Reply/App.pm
index d8bd52c..54a187c 100644
--- a/lib/Reply/App.pm
+++ b/lib/Reply/App.pm
@@ -38,11 +38,18 @@ sub run {
my $self = shift;
my @argv = @_;
+ Getopt::Long::Configure("gnu_getopt");
+
my $cfgfile = '.replyrc';
my $exitcode;
+ my @modules;
my $parsed = GetOptionsFromArray(
\@argv,
'cfg:s' => \$cfgfile,
+ 'l|lib' => sub { push @INC, 'lib' },
+ 'b|blib' => sub { push @INC, 'blib/lib', 'blib/arch' },
+ 'I:s@' => sub { push @INC, $_[1] },
+ 'M:s@' => \@modules,
'version' => sub { $exitcode = 0; version() },
'help' => sub { $exitcode = 0; usage() },
);
@@ -75,7 +82,9 @@ sub run {
}
}
- Reply->new(%args)->run;
+ my $reply = Reply->new(%args);
+ $reply->step("use $_") for @modules;
+ $reply->run;
return 0;
}
@@ -89,7 +98,7 @@ printed to C<STDOUT>, otherwise it will be printed to C<STDERR>.
sub usage {
my $fh = $_[0] ? *STDERR : *STDOUT;
- print $fh " reply [--version] [--help] [--cfg file]\n";
+ print $fh " reply [-lb] [-I dir] [-M mod] [--version] [--help] [--cfg file]\n";
}
=method version($exitcode)