summaryrefslogtreecommitdiff
path: root/Core.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Core.hs')
-rw-r--r--Core.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/Core.hs b/Core.hs
index a97bf5090..8717aee81 100644
--- a/Core.hs
+++ b/Core.hs
@@ -115,22 +115,26 @@ getViaTmp key action = do
return False
{- Output logging -}
+verbose :: Annex () -> Annex ()
+verbose a = do
+ q <- Annex.flagIsSet "quiet"
+ if (q) then return () else a
showStart :: String -> String -> Annex ()
-showStart command file = do
+showStart command file = verbose $ do
liftIO $ putStr $ command ++ " " ++ file ++ " "
liftIO $ hFlush stdout
showNote :: String -> Annex ()
-showNote s = do
+showNote s = verbose $ do
liftIO $ putStr $ "(" ++ s ++ ") "
liftIO $ hFlush stdout
showLongNote :: String -> Annex ()
-showLongNote s = do
+showLongNote s = verbose $ do
liftIO $ putStr $ "\n" ++ (indent s)
where
indent s = join "\n" $ map (\l -> " " ++ l) $ lines s
showEndOk :: Annex ()
-showEndOk = do
+showEndOk = verbose $ do
liftIO $ putStrLn "ok"
showEndFail :: Annex ()
-showEndFail = do
+showEndFail = verbose $ do
liftIO $ putStrLn "\nfailed"