fix the issue in DXProt::add_thingy
[spider.git] / cmd / show / debug_ring.pl
index 9a2eb01a3334f3e5b13803674431f6f11c0981f3..9513b9655078aa58a089edfabf913ff0173ad62d 100644 (file)
@@ -7,7 +7,17 @@ my $self = shift;
 my $line = shift;;
 return (1, $self->msg('e5')) unless $self->priv >= 9;
 
-DXDebug::dbgprintring();
-DXDebug::dbgclearring() if $line =~ /^clear$/;
+my @args = split /\s+/, $line;
+my $n;
+my $doclear;
 
-return (1, 'Contents of debug ring buffer logged. View with watchdbg.');
+for (@args) {
+       say "arg: $_";
+       $n = 0+$_ if /^\d+$/;
+       $doclear++ if /^clear$/;
+}
+my $lines = DXDebug::dbgprintring($n);
+DXDebug::dbgclearring() if $doclear;
+dge;
+
+return (1, qq{Contents of $lines lines of debug ring buffer logged. View with watchdbg.});