diff options
-rw-r--r-- | Annex.hs | 7 | ||||
-rw-r--r-- | Command/Init.hs | 2 | ||||
-rw-r--r-- | Content.hs | 3 | ||||
-rw-r--r-- | Messages.hs | 7 | ||||
-rw-r--r-- | Options.hs | 6 |
5 files changed, 13 insertions, 12 deletions
@@ -10,6 +10,7 @@ module Annex ( Annex, AnnexState(..), + OutputType(..), new, run, eval, @@ -48,7 +49,7 @@ data AnnexState = AnnexState , backends :: [Backend Annex] , remotes :: [Remote Annex] , repoqueue :: Queue - , quiet :: Bool + , output :: OutputType , force :: Bool , fast :: Bool , branchstate :: BranchState @@ -63,13 +64,15 @@ data AnnexState = AnnexState , cipher :: Maybe Cipher } +data OutputType = NormalOutput | QuietOutput + newState :: Git.Repo -> AnnexState newState gitrepo = AnnexState { repo = gitrepo , backends = [] , remotes = [] , repoqueue = empty - , quiet = False + , output = NormalOutput , force = False , fast = False , branchstate = startBranchState diff --git a/Command/Init.hs b/Command/Init.hs index 2abe4c661..6ba7df682 100644 --- a/Command/Init.hs +++ b/Command/Init.hs @@ -7,8 +7,6 @@ module Command.Init where -import Control.Monad - import Command import qualified Annex import UUID diff --git a/Content.hs b/Content.hs index 1c2475240..e4bbee528 100644 --- a/Content.hs +++ b/Content.hs @@ -23,11 +23,10 @@ module Content ( saveState ) where -import System.IO.Error (try) import System.Directory import Control.Monad.State (liftIO) import System.Path -import Control.Monad (when, filterM) +import Control.Monad import System.Posix.Files import System.FilePath import Data.Maybe diff --git a/Messages.hs b/Messages.hs index 36f0b89c5..b2c871ede 100644 --- a/Messages.hs +++ b/Messages.hs @@ -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 diff --git a/Options.hs b/Options.hs index 7f78f44f6..768a1c289 100644 --- a/Options.hs +++ b/Options.hs @@ -26,9 +26,9 @@ commonOptions = "allow actions that may lose annexed data" , Option ['F'] ["fast"] (NoArg (setfast True)) "avoid slow operations" - , Option ['q'] ["quiet"] (NoArg (setquiet True)) + , Option ['q'] ["quiet"] (NoArg (setoutput Annex.QuietOutput)) "avoid verbose output" - , Option ['v'] ["verbose"] (NoArg (setquiet False)) + , Option ['v'] ["verbose"] (NoArg (setoutput Annex.NormalOutput)) "allow verbose output (default)" , Option ['d'] ["debug"] (NoArg (setdebug)) "show debug messages" @@ -38,7 +38,7 @@ commonOptions = where setforce v = Annex.changeState $ \s -> s { Annex.force = v } setfast v = Annex.changeState $ \s -> s { Annex.fast = v } - setquiet v = Annex.changeState $ \s -> s { Annex.quiet = v } + setoutput v = Annex.changeState $ \s -> s { Annex.output = v } setforcebackend v = Annex.changeState $ \s -> s { Annex.forcebackend = Just v } setdebug = liftIO $ updateGlobalLogger rootLoggerName $ setLevel DEBUG |