aboutsummaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-30 15:28:17 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-30 15:28:17 -0400
commit508920bf728cfb5e4568b68a2943bd33efac26bc (patch)
treed04529a6b2529e771a65ac3c724c33067b9ccb2d /Messages.hs
parent4cd5738bb29278498b06b4f4d3edd4962c7a0eea (diff)
Improve behavior when a git-annex command is told to operate on a file that doesn't exist. It will now continue to other files specified after that on the command line, and only error out at the end.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/Messages.hs b/Messages.hs
index 0e83a7243..5dffbd8de 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -19,7 +19,7 @@ module Messages (
showEndOk,
showEndFail,
showEndResult,
- showErr,
+ toplevelWarning,
warning,
warningIO,
indent,
@@ -117,15 +117,16 @@ showEndResult ok = handleMessage (JSON.end ok) $ putStrLn msg
| ok = "ok"
| otherwise = "failed"
-showErr :: (Show a) => a -> Annex ()
-showErr e = warning' $ "git-annex: " ++ show e
+toplevelWarning :: Bool -> String -> Annex ()
+toplevelWarning makeway s = warning' makeway ("git-annex: " ++ s)
warning :: String -> Annex ()
-warning = warning' . indent
+warning = warning' True . indent
-warning' :: String -> Annex ()
-warning' w = do
- handleMessage q $ putStr "\n"
+warning' :: Bool -> String -> Annex ()
+warning' makeway w = do
+ when makeway $
+ handleMessage q $ putStr "\n"
liftIO $ do
hFlush stdout
hPutStrLn stderr w