Document hints plugin
[p5sagit/Eval-WithLexicals.git] / bin / tinyrepl
index 236b081..4b78618 100755 (executable)
@@ -5,6 +5,12 @@ use Eval::WithLexicals;
 use Term::ReadLine;
 use Data::Dumper;
 
+use Getopt::Long;
+
+GetOptions(
+  "plugin=s" => \my @plugins
+);
+
 $SIG{INT} = sub { warn "SIGINT\n" };
 
 { package Data::Dumper; no strict 'vars';
@@ -12,7 +18,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$ ');