diff options
author | Bas Zoetekouw <bas> | 2008-10-04 19:15:57 +0000 |
---|---|---|
committer | Bas Zoetekouw <bas> | 2008-10-04 19:15:57 +0000 |
commit | 63cb7838fb3f021e74c9774b1b89f0536bf5c169 (patch) | |
tree | 2e73eff6267c353404bfe46fd4fa00cd1fe1b1b8 /check_trans.pl | |
parent | 7d3e36ae44edf932da08ce804d28b10e035aeb4e (diff) |
Reset the terminal colour when ctrl-c is pressed
CVS version numbers
check_trans.pl: 1.80 -> 1.81
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-x | check_trans.pl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/check_trans.pl b/check_trans.pl index 57df8459cf8..3d0c99f48cd 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -138,6 +138,9 @@ sub verbose; #== "main" #== { + # install a signal handler to catch Ctrl-C + $SIG{'INT'} = \&handle_INT; + my ($language,$file_pattern,%OPT) = parse_cmdargs(); my %translators = read_translators( $language, $OPT{m} ); my %emails_to_send; @@ -387,7 +390,15 @@ sub verbose print @_, "\n"; } - +#================================================= +#== handles INT signal +#== +sub handle_INT +{ + # reset terminal color + print color('reset'); + die( "Interrupted by user" ); +} #================================================= #== send out the emails |