diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-05-29 05:07:33 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-05-29 05:07:33 -0500 |
commit | 08ec0d4c0a2ef14d0e7ca78dd5a0b54dcade1132 (patch) | |
tree | 673f58c06c5667238d5fc6cd6b72d0b197e467af | |
parent | ce62e06a2ad801aec1bf9f393475b01d25670892 (diff) | |
download | reply-08ec0d4c0a2ef14d0e7ca78dd5a0b54dcade1132.tar.gz reply-08ec0d4c0a2ef14d0e7ca78dd5a0b54dcade1132.zip |
clean up line reading a bit
-rw-r--r-- | lib/App/REPL.pm | 4 | ||||
-rw-r--r-- | lib/App/REPL/Plugin/Defaults.pm | 8 |
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 <>; } |