From: Matt S Trout Date: Wed, 19 Feb 2014 21:10:25 +0000 (+0000) Subject: add dump command to shell to start enabling debugging X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ffacb8aa43c43ffd7c89a412b65a3924571fe383;p=scpubgit%2FDKit.git add dump command to shell to start enabling debugging --- diff --git a/bin/dx-shell b/bin/dx-shell index 572c9d2..6848ed6 100644 --- a/bin/dx-shell +++ b/bin/dx-shell @@ -6,6 +6,7 @@ use DX::Solver; use DX::Lib::FS; use Term::ReadLine; use Devel::Dwarn; +use Sub::Quote; my $solver = DX::Solver->new(observation_policy => sub { 1 }); @@ -62,6 +63,12 @@ $tcl->CreateCommand(run => sub { return; }); +$tcl->CreateCommand(dump => sub { + my (undef, undef, undef, $to_dump) = @_; + my $filter = quote_sub($to_dump); + Dwarn(map $filter->($_), @res); +}); + sub mangle_args { my @args = @_; map { $_ =~ /^'(.*)'$/ ? \do { my $x = $1 } : $_ } @args;