changeset 20637:8cffc806cd7e

Watch for CTRL+C when running stats.pl and exit, rather than making you hit CTRL+C a billion times
author Mark Doliner <mark@kingant.net>
date Tue, 25 Sep 2007 07:08:29 +0000
parents 4604cad304cb
children da0355feddbe
files po/stats.pl
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/po/stats.pl	Tue Sep 25 04:54:04 2007 +0000
+++ b/po/stats.pl	Tue Sep 25 07:08:29 2007 +0000
@@ -63,6 +63,10 @@
 	$po = $pos[$index];
 	print STDERR "$po..." if($ARGV[0] eq '-v');
 	system("msgmerge $po.po $PACKAGE.pot -o $po.new 2>/dev/null");
+	if (($? & 127) == 2) {
+		printf STDERR "Caught keyboard interrupt--exiting\n";
+		exit
+	}
 	$_ = `msgfmt --statistics $po.new -o /dev/null 2>&1`;
 	chomp;
 	if(/(\d+) translated message/) { $trans = $1; }