Exit with 1 on comments and 2 on failure
This commit is contained in:
parent
8b7c0be06f
commit
68cc00b6e8
|
@ -211,8 +211,12 @@ getOption (_:rest) flag def = getOption rest flag def
|
||||||
main = do
|
main = do
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
parsedArgs <- parseArguments args
|
parsedArgs <- parseArguments args
|
||||||
status <- process parsedArgs
|
do
|
||||||
if status then exitSuccess else exitFailure
|
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 Nothing = return False
|
||||||
process (Just (options, files)) =
|
process (Just (options, files)) =
|
||||||
|
|
Loading…
Reference in New Issue