summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-08-16 03:37:03 -0400
committerJesse Luehrs <doy@tozt.net>2016-08-16 03:38:22 -0400
commit96ed58c6de66c8495cb3982373fb82ab19508536 (patch)
treeadd499f80e7be10bc7f9aaf2972be637cd1dc516
parent488afdc2363b34fc1858826f3a0fa54fdb04f9bf (diff)
downloadreply-96ed58c6de66c8495cb3982373fb82ab19508536.tar.gz
reply-96ed58c6de66c8495cb3982373fb82ab19508536.zip
add #vars command to list currently in scope variable names (#39)
-rw-r--r--Changes1
-rw-r--r--lib/Reply/Plugin/Defaults.pm8
2 files changed, 9 insertions, 0 deletions
diff --git a/Changes b/Changes
index 45fba1b..96cbc8a 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Revision history for Reply
{{$NEXT}}
+ - add #vars command to list currently in scope variable names (garu, #39)
0.40 2016-06-25
- fix docs (y, #49)
diff --git a/lib/Reply/Plugin/Defaults.pm b/lib/Reply/Plugin/Defaults.pm
index bbe5934..886e75f 100644
--- a/lib/Reply/Plugin/Defaults.pm
+++ b/lib/Reply/Plugin/Defaults.pm
@@ -92,6 +92,13 @@ sub command_q {
return '';
}
+sub command_vars {
+ my $self = shift;
+
+ my %env = map { %$_ } $self->publish('lexical_environment');
+ return '(' . join(', ', map { qq<'$_'> } keys %env) . ')';
+}
+
sub loop {
my $self = shift;
my ($continue) = @_;
@@ -105,6 +112,7 @@ sub loop {
new
command_q
+ command_vars
=end Pod::Coverage