New plugin: tail (undocumented feature)
This commit is contained in:
parent
66e41c14aa
commit
5d37f7af5b
1 changed files with 15 additions and 0 deletions
15
plugins/tail
Normal file
15
plugins/tail
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!perl
|
||||||
|
|
||||||
|
sub command :Tab(tail) {
|
||||||
|
my ($self, $cart, $command) = @_;
|
||||||
|
|
||||||
|
return NEXT if $command ne 'tail';
|
||||||
|
|
||||||
|
my $n = (`tput lines 2>/dev/null` || 13) - 3;
|
||||||
|
my $c = (`tput cols 2>/dev/null` || 80) + 0;
|
||||||
|
|
||||||
|
# ew :)
|
||||||
|
system "perl -lane's/CHECKOUT\\s+\\S+\\s+// or next; s/ #// or next; s/_/ /; print' .revbank.log | tail -n$n | perl -ple'\$_ = substr \$_, 0, $c'";
|
||||||
|
|
||||||
|
return ACCEPT;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue