diff options
-rw-r--r-- | lib/Reply.pm | 9 | ||||
-rw-r--r-- | lib/Reply/Plugin/FancyPrompt.pm | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/Reply.pm b/lib/Reply.pm index 66ef8a4..699e808 100644 --- a/lib/Reply.pm +++ b/lib/Reply.pm @@ -94,7 +94,8 @@ sub run { } catch { $self->_print_error($_); - } + }; + $self->_loop; } print "\n"; } @@ -140,6 +141,12 @@ sub _print_result { $self->_wrapped_plugin('print_result', @result); } +sub _loop { + my $self = shift; + + $self->_chained_plugin('loop'); +} + sub _wrapped_plugin { my $self = shift; my @plugins = ref($_[0]) ? @{ shift() } : $self->plugins; diff --git a/lib/Reply/Plugin/FancyPrompt.pm b/lib/Reply/Plugin/FancyPrompt.pm index aec5b82..d998763 100644 --- a/lib/Reply/Plugin/FancyPrompt.pm +++ b/lib/Reply/Plugin/FancyPrompt.pm @@ -14,7 +14,12 @@ sub new { sub prompt { my $self = shift; my ($next) = @_; - return $self->{counter}++ . $next->(); + return $self->{counter} . $next->(); +} + +sub loop { + my $self = shift; + $self->{counter}++; } 1; |