diff --git a/src/main/java/com/github/heuermh/cooper/Cooper.java b/src/main/java/com/github/heuermh/cooper/Cooper.java index cc27d56..797f836 100644 --- a/src/main/java/com/github/heuermh/cooper/Cooper.java +++ b/src/main/java/com/github/heuermh/cooper/Cooper.java @@ -161,6 +161,14 @@ public static void main(final String[] args) { } logger = LoggerFactory.getLogger(Cooper.class); + // install a signal handler to exit on SIGPIPE + sun.misc.Signal.handle(new sun.misc.Signal("PIPE"), new sun.misc.SignalHandler() { + @Override + public void handle(final sun.misc.Signal signal) { + System.exit(0); + } + }); + System.exit(new CommandLine(new Cooper()).execute(args)); } }