summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-05-29 05:07:33 -0500
committerJesse Luehrs <doy@tozt.net>2013-05-29 05:07:33 -0500
commit08ec0d4c0a2ef14d0e7ca78dd5a0b54dcade1132 (patch)
tree673f58c06c5667238d5fc6cd6b72d0b197e467af
parentce62e06a2ad801aec1bf9f393475b01d25670892 (diff)
downloadreply-08ec0d4c0a2ef14d0e7ca78dd5a0b54dcade1132.tar.gz
reply-08ec0d4c0a2ef14d0e7ca78dd5a0b54dcade1132.zip
clean up line reading a bit
-rw-r--r--lib/App/REPL.pm4
-rw-r--r--lib/App/REPL/Plugin/Defaults.pm8
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/App/REPL.pm b/lib/App/REPL.pm
index 484cb84..bc7b8a6 100644
--- a/lib/App/REPL.pm
+++ b/lib/App/REPL.pm
@@ -87,8 +87,8 @@ sub run {
sub _read {
my $self = shift;
- $self->_wrapped_plugin('display_prompt');
- my ($line) = $self->_wrapped_plugin('read_line');
+ my $prompt = $self->_wrapped_plugin('prompt');
+ my ($line) = $self->_wrapped_plugin('read_line', $prompt);
return $line;
}
diff --git a/lib/App/REPL/Plugin/Defaults.pm b/lib/App/REPL/Plugin/Defaults.pm
index 057fcce..23368e8 100644
--- a/lib/App/REPL/Plugin/Defaults.pm
+++ b/lib/App/REPL/Plugin/Defaults.pm
@@ -15,15 +15,13 @@ use base 'App::REPL::Plugin';
use Eval::Closure;
-sub display_prompt {
- my $self = shift;
-
- print "> ";
-}
+sub prompt { "> " }
sub read_line {
my $self = shift;
+ my ($next, $prompt) = @_;
+ print $prompt;
return scalar <>;
}