respond to alarm signal regardless of interval
[barcat.git] / barcat
diff --git a/barcat b/barcat
index 1818493a8af4603898a2e4b7f1265c6bcfda948d..b051353ecf2d228ffaeade4e1ab19021cfc569b4 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -83,12 +83,13 @@ $opt{'value-length'} = 1 if $opt{unmodified};
 
 my (@lines, @values, @order);
 
+$SIG{ALRM} = sub {
+       show_lines();
+       alarm $opt{interval} if defined $opt{interval};
+};
+
 if (defined $opt{interval}) {
        $opt{interval} ||= 1;
-       $SIG{ALRM} = sub {
-               show_lines();
-               alarm $opt{interval};
-       };
        alarm $opt{interval};
 
        eval {
@@ -286,6 +287,7 @@ Short integers are aligned but kept without decimal point.
 =item -t, --interval[=<seconds>]
 
 Interval time to output partial progress.
+An update can also be forced by sending a I<SIGALRM> alarm signal.
 
 =item -l, --length=[-]<size>[%]