From c18f54da211be1bd0f77d9d311b97a58e7ebb23e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 26 Jun 2013 14:38:42 -0400 Subject: add a few more command line options (RT86341) --- lib/Reply/App.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/Reply/App.pm') 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, otherwise it will be printed to C. 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) -- cgit v1.2.3-54-g00ecf