[Bast-commits] r4322 - trunk/Devel-REPL/lib/Devel/REPL/Plugin

nothingmuch at dev.catalyst.perl.org nothingmuch at dev.catalyst.perl.org
Mon May 5 19:20:05 BST 2008


Author: nothingmuch
Date: 2008-05-05 19:20:04 +0100 (Mon, 05 May 2008)
New Revision: 4322

Modified:
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm
Log:
print a warning when Completion is loaded but the Term::ReadLine object doesn't support completion

Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm	2008-05-05 17:55:23 UTC (rev 4321)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/Completion.pm	2008-05-05 18:20:04 UTC (rev 4322)
@@ -18,6 +18,12 @@
   default => sub { 0 },
 );
 
+has no_term_class_warning => (
+  isa => "Bool",
+  is  => "rw",
+  default => 0,
+);
+
 sub BEFORE_PLUGIN {
   my ($self) = @_;
 
@@ -29,6 +35,13 @@
   };
 }
 
+sub AFTER_PLUGIN {
+  my ($self) = @_;
+
+  warn "Term::ReadLine::Gnu is required for the Completion plugin to work"
+    unless $self->term->isa("Term::ReadLine::Gnu") and !$self->no_term_class_warning;
+}
+
 sub _completion {
   my ($self, $text, $line, $start, $end) = @_;
 




More information about the Bast-commits mailing list