git.shiar.nl
/
barcat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
prefer SIGINFO for statistics if available
[barcat.git]
/
barcat
diff --git
a/barcat
b/barcat
index bdfde47398a22d678ef8e2b02bd01a2afd74193f..de3f6f8459721ae78c734401961607eaef4c4e20 100755
(executable)
--- a/
barcat
+++ b/
barcat
@@
-87,6
+87,7
@@
$opt{'value-length'} = 1 if $opt{unmodified};
my (@lines, @values, @order);
my (@lines, @values, @order);
+$SIG{$_} = \&show_stat for exists $SIG{INFO} ? 'INFO' : 'QUIT';
$SIG{ALRM} = sub {
show_lines();
alarm $opt{interval} if defined $opt{interval} and $opt{interval} > 0;
$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();
}
show_lines();
-
if ($opt{stat})
{
+
sub show_stat
{
if ($opt{hidemin} or $opt{hidemax}) {
$opt{hidemin} ||= 1;
$opt{hidemax} ||= @lines;
if ($opt{hidemin} or $opt{hidemax}) {
$opt{hidemin} ||= 1;
$opt{hidemax} ||= @lines;
@@
-238,6
+239,7
@@
if ($opt{stat}) {
}
say '';
}
}
say '';
}
+show_stat() if $opt{stat};
__END__
=encoding utf8
__END__
=encoding utf8