From 68cc00b6e8611884b8d8ee3131841b88a02e238f Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Thu, 14 Nov 2013 22:35:38 -0800 Subject: [PATCH] Exit with 1 on comments and 2 on failure --- shellcheck.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shellcheck.hs b/shellcheck.hs index 3ec71b8..9f7c9b7 100644 --- a/shellcheck.hs +++ b/shellcheck.hs @@ -211,8 +211,12 @@ getOption (_:rest) flag def = getOption rest flag def main = do args <- getArgs parsedArgs <- parseArguments args - status <- process parsedArgs - if status then exitSuccess else exitFailure + do + status <- process parsedArgs + if status then exitSuccess else exitWith (ExitFailure 1) + `catch` \err -> do + printErr $ show err + exitWith $ ExitFailure 2 process Nothing = return False process (Just (options, files)) =