git.shiar.nl
/
barcat.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
51e0fee
)
show statistics on SIGQUIT
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 12 Sep 2019 16:56:15 +0000
(18:56 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 12 Sep 2019 15:48:11 +0000
(17:48 +0200)
barcat
patch
|
blob
|
history
diff --git
a/barcat
b/barcat
index bdfde47398a22d678ef8e2b02bd01a2afd74193f..650e4060b1b30fd9c743d2f870c6998ade606578 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-87,6
+87,7
@@
$opt{'value-length'} = 1 if $opt{unmodified};
my (@lines, @values, @order);
+$SIG{QUIT} = \&show_stat;
$SIG{ALRM} = sub {
show_lines();
alarm $opt{interval} if defined $opt{interval} and $opt{interval} > 0;
@@
-220,7
+221,7
@@
say '' if $opt{spark};
}
show_lines();
-
if ($opt{stat})
{
+
sub show_stat
{
if ($opt{hidemin} or $opt{hidemax}) {
$opt{hidemin} ||= 1;
$opt{hidemax} ||= @lines;
@@
-238,6
+239,7
@@
if ($opt{stat}) {
}
say '';
}
+show_stat() if $opt{stat};
__END__
=encoding utf8