X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FEval-WithLexicals.git;a=blobdiff_plain;f=bin%2Ftinyrepl;h=f9087ea034fabec235070a4d1311f7bd621e6bd6;hp=236b081eb1f9b182217f83b8e26aa13e7cc07d89;hb=8d732f3064bb88d682504f365ef1af62c6598b8c;hpb=a6bd7aca656475de49bf3b20afceddffe2130060 diff --git a/bin/tinyrepl b/bin/tinyrepl index 236b081..f9087ea 100755 --- a/bin/tinyrepl +++ b/bin/tinyrepl @@ -4,6 +4,11 @@ use strictures 1; use Eval::WithLexicals; use Term::ReadLine; use Data::Dumper; +use Getopt::Long; + +GetOptions( + "plugin=s" => \my @plugins +); $SIG{INT} = sub { warn "SIGINT\n" }; @@ -12,7 +17,10 @@ $SIG{INT} = sub { warn "SIGINT\n" }; $Quotekeys = 0; } -my $eval = Eval::WithLexicals->new; +my $eval = @plugins + ? Eval::WithLexicals->with_plugins(@plugins)->new + : Eval::WithLexicals->new; + my $read = Term::ReadLine->new('Perl REPL'); while (1) { my $line = $read->readline('re.pl$ ');