aboutsummaryrefslogtreecommitdiff
path: root/Core.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-25 18:32:29 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-25 18:32:29 -0400
commitd0a9cdadafca1ee0da100a993b23e8a063f86bf8 (patch)
tree46d6955950bafc004fdc47c3db499e5e2a4849fb /Core.hs
parent8beed17168aab12bb4045b6d8635b37503d5099b (diff)
add dropkey subcommand and --quiet
Needed for better git annex move --from
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"