From 508920bf728cfb5e4568b68a2943bd33efac26bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Apr 2015 15:28:17 -0400 Subject: 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. --- Messages.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Messages.hs') 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 -- cgit v1.2.3