Permalink
Browse files

support the prompt in the Perl binding

  • Loading branch information...
jrockway committed Feb 27, 2011
1 parent 5dd691e commit 022fa314b6a806fc2abd2487ad917424933105b8
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/Stylish/Server/Component/REPL.pm
@@ -42,6 +42,13 @@ class Stylish::Server::Component::REPL with Stylish::Server::Component {
method SESSION($session) {
$session->provide( repl => $self );
+
+ $session->register_command({
+ name => 'repl_prompt',
+ object => $self,
+ method => 'repl_prompt',
+ });
+
$session->register_command({
name => 'repl',
object => $self,
@@ -96,6 +103,10 @@ class Stylish::Server::Component::REPL with Stylish::Server::Component {
return { success => $is_success, result => $result };
}
+ method repl_prompt(){
+ return { prompt => 'PERL>' }
+ }
+
method write_stdin(Str :$name, Str :$input){
$self->get_repl($name)->push_write($input);
}

0 comments on commit 022fa31

Please sign in to comment.