From: David Leadbeater Date: Sat, 29 Jan 2011 14:31:24 +0000 (+0000) Subject: Update SYNOPSIS to match tinyrepl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=623c94c9bd05a3805adbc26345a10fc6e6ce02a5;p=p5sagit%2FEval-WithLexicals.git Update SYNOPSIS to match tinyrepl --- diff --git a/bin/tinyrepl b/bin/tinyrepl index 4b78618..f9087ea 100755 --- a/bin/tinyrepl +++ b/bin/tinyrepl @@ -4,7 +4,6 @@ use strictures 1; use Eval::WithLexicals; use Term::ReadLine; use Data::Dumper; - use Getopt::Long; GetOptions( diff --git a/lib/Eval/WithLexicals.pm b/lib/Eval/WithLexicals.pm index e462063..752de55 100644 --- a/lib/Eval/WithLexicals.pm +++ b/lib/Eval/WithLexicals.pm @@ -151,6 +151,11 @@ Eval::WithLexicals - pure perl eval with persistent lexical variables use Eval::WithLexicals; use Term::ReadLine; use Data::Dumper; + use Getopt::Long; + + GetOptions( + "plugin=s" => \my @plugins + ); $SIG{INT} = sub { warn "SIGINT\n" }; @@ -159,7 +164,10 @@ Eval::WithLexicals - pure perl eval with persistent lexical variables $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$ ');