Commit c41d2e9d authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Stopped output of blank newlines

parent 369538e8
...@@ -26,7 +26,8 @@ status opts msg = unless (optVerbosity opts < VerbStatus) ...@@ -26,7 +26,8 @@ status opts msg = unless (optVerbosity opts < VerbStatus)
(putStrLn $ msg ++ " ...") (putStrLn $ msg ++ " ...")
warn :: Options -> [Message] -> IO () warn :: Options -> [Message] -> IO ()
warn opts msgs = when (optWarn opts) $ putErrLn (show $ ppMessages msgs) warn opts msgs = when (optWarn opts && not (null msgs))
$ putErrLn (show $ ppMessages msgs)
-- |Print an error message on 'stderr' -- |Print an error message on 'stderr'
putErrLn :: String -> IO () putErrLn :: String -> IO ()
...@@ -39,7 +40,7 @@ putErrsLn = mapM_ putErrLn ...@@ -39,7 +40,7 @@ putErrsLn = mapM_ putErrLn
-- |Print a list of 'String's as error messages on 'stderr' -- |Print a list of 'String's as error messages on 'stderr'
-- and abort the program -- and abort the program
abortWith :: [String] -> IO a abortWith :: [String] -> IO a
abortWith errs = putErrsLn errs >> exitFailure abortWith errs = unless (null errs) (putErrsLn errs) >> exitFailure
-- |Print a single error message on 'stderr' and abort the program -- |Print a single error message on 'stderr' and abort the program
abortWithMessage :: Message -> IO a abortWithMessage :: Message -> IO a
...@@ -47,7 +48,9 @@ abortWithMessage msg = abortWithMessages [msg] ...@@ -47,7 +48,9 @@ abortWithMessage msg = abortWithMessages [msg]
-- |Print a list of error messages on 'stderr' and abort the program -- |Print a list of error messages on 'stderr' and abort the program
abortWithMessages :: [Message] -> IO a abortWithMessages :: [Message] -> IO a
abortWithMessages msgs = putErrLn (show $ ppMessages msgs) >> exitFailure abortWithMessages msgs = do
unless (null msgs) $ putErrLn (show $ ppMessages msgs)
exitFailure
-- |Raise an internal error -- |Raise an internal error
internalError :: String -> a internalError :: String -> a
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment