generalize quiet flag to output type

This will allow adding other styles of output.
This commit is contained in:
Joey Hess 2011-09-01 13:35:07 -04:00
parent 55783d886d
commit 57dd34c6be
5 changed files with 13 additions and 12 deletions

View file

@ -9,7 +9,6 @@ module Messages where
import Control.Monad.State (liftIO)
import System.IO
import Control.Monad (unless)
import Data.String.Utils
import Types
@ -17,8 +16,10 @@ import qualified Annex
verbose :: Annex () -> Annex ()
verbose a = do
q <- Annex.getState Annex.quiet
unless q a
output <- Annex.getState Annex.output
case output of
Annex.NormalOutput -> a
_ -> return ()
showStart :: String -> String -> Annex ()
showStart command file = verbose $ liftIO $ do