From fc00838faa4480a03e8a33fedc80c4648817bb93 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 29 Nov 2015 02:48:38 +0000 Subject: mlib: SYSTEM_DEFAULT handlers for SIGINT and SIGPIPE This makes interrupting the potentially long output of "dtas-mlib dump" less ugly. Perhaps it makes sense for our other scripts to follow suit. --- bin/dtas-mlib | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bin') diff --git a/bin/dtas-mlib b/bin/dtas-mlib index d897d83..16876a2 100755 --- a/bin/dtas-mlib +++ b/bin/dtas-mlib @@ -3,6 +3,8 @@ # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) usage = "#$0 [-d DATABASE-URI] ACTION [ARGS]" Thread.abort_on_exception = $stderr.sync = $stdout.sync = true +trap(:INT, 'SYSTEM_DEFAULT') +trap(:PIPE, 'SYSTEM_DEFAULT') require 'dtas/mlib' require 'optparse' path = '~/.dtas/mlib.sqlite' -- cgit v1.2.3-24-ge0c7