summaryrefslogtreecommitdiffstats
path: root/lib/Reply/Plugin/ReadLine.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-05-30 04:41:11 -0500
committerJesse Luehrs <doy@tozt.net>2013-05-30 04:41:11 -0500
commitd8a90a03e9c5e8e2732374a10e0e79289ffb793c (patch)
tree98b6385d26dad2a14687c2c51d402c5b6ebdc837 /lib/Reply/Plugin/ReadLine.pm
parent69e4ff7c28debe5cae5bd505d5df12bd12bdd11a (diff)
downloadreply-d8a90a03e9c5e8e2732374a10e0e79289ffb793c.tar.gz
reply-d8a90a03e9c5e8e2732374a10e0e79289ffb793c.zip
App::REPL -> Reply
Diffstat (limited to 'lib/Reply/Plugin/ReadLine.pm')
-rw-r--r--lib/Reply/Plugin/ReadLine.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Reply/Plugin/ReadLine.pm b/lib/Reply/Plugin/ReadLine.pm
new file mode 100644
index 0000000..dc9c617
--- /dev/null
+++ b/lib/Reply/Plugin/ReadLine.pm
@@ -0,0 +1,25 @@
+package Reply::Plugin::ReadLine;
+use strict;
+use warnings;
+
+use base 'Reply::Plugin';
+
+use Term::ReadLine;
+
+sub new {
+ my $class = shift;
+
+ my $self = $class->SUPER::new(@_);
+ $self->{term} = Term::ReadLine->new('Reply');
+
+ return $self;
+}
+
+sub read_line {
+ my $self = shift;
+ my ($next, $prompt) = @_;
+
+ return $self->{term}->readline($prompt);
+}
+
+1;