X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?a=blobdiff_plain;f=xlog%2Fbin%2Freport;h=92a6a5e2793004467b195b4976a09f8cd3bc35d9;hb=HEAD;hp=f6ea1d160de4d94c87e96b0220e9651d4f3c23e3;hpb=87c1744952c472b438731e0022c5bcb4709eac3d;p=modbot-mtm.git diff --git a/xlog/bin/report b/xlog/bin/report index f6ea1d1..92a6a5e 100755 --- a/xlog/bin/report +++ b/xlog/bin/report @@ -7,6 +7,8 @@ use CGI qw/:standard *table end_* -no_xhtml/; our $timesquash = 3; # no. of digits at end of time to replace with x, 0..4 +our %reasonshow = qw(approve 1 reject 1); +# no. of words to show for (;;) { last unless @ARGV; @@ -16,6 +18,8 @@ for (;;) { while (m/^-./) { if (s/^-t([0-4])/-/) { $timesquash= $1; + } elsif (s/^-r(\w+)=(\d)$//) { + $reasonshow{$1}= $2; } else { die "bad option $_ ?"; } @@ -75,6 +79,14 @@ sub processline_print () { $sp[5]= a({ href=>"$staticfiles/nr-$s[6].txt" }, $sp[5] ); } + if ($sp[5] =~ m/^\w+\b/ && + defined (my $reasonshow= $reasonshow{$&})) { + my @reas= split /\s+/, $sp[5]; + $reasonshow--; + $#reas = $reasonshow if $#reas > $reasonshow; + $sp[5] = join ' ', @reas; + } + print "$sp[0]"; print "$sp[1] $sp[2]"; print td([@sp[3..5]]),"\n";