aboutsummaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-09-06 13:46:08 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-09-06 13:46:08 -0400
commit07125dca53ece4896a83fad00b7f43101855ce9c (patch)
treec74bd30e459589239134f3e01603e8e8cc122ec7 /Messages.hs
parent14f75ced75aa73d4f8dbc45cdc697bac1535fb37 (diff)
Improve display of newlines around error and warning messages.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Messages.hs b/Messages.hs
index faa4dbcde..492251981 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -73,16 +73,17 @@ showEndResult b = handle (JSON.end b) $ putStrLn msg
| otherwise = "failed"
showErr :: (Show a) => a -> Annex ()
-showErr e = liftIO $ do
- hFlush stdout
- hPutStrLn stderr $ "git-annex: " ++ show e
+showErr e = warning' $ "git-annex: " ++ show e
warning :: String -> Annex ()
-warning w = do
+warning w = warning' (indent w)
+
+warning' :: String -> Annex ()
+warning' w = do
handle q $ putStr "\n"
liftIO $ do
hFlush stdout
- hPutStrLn stderr $ indent w
+ hPutStrLn stderr w
indent :: String -> String
indent s = join "\n" $ map (\l -> " " ++ l) $ lines s