From c45e81567c5701ffc8dba3ac778d8cc036ed0a0c Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 28 Jun 2007 15:35:30 +0000 Subject: exit with errcode --- it.class | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/it.class b/it.class index 1966c62..ec4a217 100644 --- a/it.class +++ b/it.class @@ -146,7 +146,17 @@ function error($p = array(), $body = "", $to = "") function fatal($title='', $body='', $to='') { it::error($title, $body, $to); - exit; + exit(1); +} + + +/** + * Print message to stderr and exit with error code + */ +function bail($message = "bailed.\n") +{ + fputs(STDERR, $message); + exit(1); } -- cgit v1.2.3