diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-25 18:32:29 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-25 18:32:29 -0400 |
commit | d0a9cdadafca1ee0da100a993b23e8a063f86bf8 (patch) | |
tree | 46d6955950bafc004fdc47c3db499e5e2a4849fb /Core.hs | |
parent | 8beed17168aab12bb4045b6d8635b37503d5099b (diff) |
add dropkey subcommand and --quiet
Needed for better git annex move --from
Diffstat (limited to 'Core.hs')
-rw-r--r-- | Core.hs | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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" |