diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-27 13:23:52 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-27 13:54:33 -0400 |
commit | 76102c1c7541e7b10c3a3fbe242e9856fef955b3 (patch) | |
tree | e9c0b61fd1913c59c68dfa9929a860fc61d767bf /Option.hs | |
parent | e0b7012ccc405dedb556b8c940eb66e42304bc73 (diff) |
display "Recording state in git..." when staging the journal
A bit tricky to avoid printing it twice in a row when there are queued git
commands to run and journal to stage.
Added a generic way to run an action that may output multiple side
messages, with only the first displayed.
Diffstat (limited to 'Option.hs')
-rw-r--r-- | Option.hs | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -20,6 +20,7 @@ import System.Log.Logger import Common.Annex import qualified Annex +import Types.Messages import Limit import Usage @@ -31,11 +32,11 @@ common = "avoid slow operations" , Option ['a'] ["auto"] (NoArg (setauto True)) "automatic mode" - , Option ['q'] ["quiet"] (NoArg (setoutput Annex.QuietOutput)) + , Option ['q'] ["quiet"] (NoArg (setoutput QuietOutput)) "avoid verbose output" - , Option ['v'] ["verbose"] (NoArg (setoutput Annex.NormalOutput)) + , Option ['v'] ["verbose"] (NoArg (setoutput NormalOutput)) "allow verbose output (default)" - , Option ['j'] ["json"] (NoArg (setoutput Annex.JSONOutput)) + , Option ['j'] ["json"] (NoArg (setoutput JSONOutput)) "enable JSON output" , Option ['d'] ["debug"] (NoArg setdebug) "show debug messages" @@ -46,7 +47,8 @@ common = setforce v = Annex.changeState $ \s -> s { Annex.force = v } setfast v = Annex.changeState $ \s -> s { Annex.fast = v } setauto v = Annex.changeState $ \s -> s { Annex.auto = v } - setoutput v = Annex.changeState $ \s -> s { Annex.output = v } + setoutput v = Annex.changeState $ \s -> + s { Annex.output = (Annex.output s) { outputType = v } } setforcebackend v = Annex.changeState $ \s -> s { Annex.forcebackend = Just v } setdebug = liftIO $ updateGlobalLogger rootLoggerName $ setLevel DEBUG |