generalize quiet flag to output type
This will allow adding other styles of output.
This commit is contained in:
parent
55783d886d
commit
57dd34c6be
5 changed files with 13 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue