diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-14 19:27:00 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-14 19:27:22 -0400 |
commit | bfe38f8ff16dc6ccc32d545e6fed87817caa26cf (patch) | |
tree | 65efec376ee385efe5d538aa2453b7b925e8aee5 /Messages.hs | |
parent | 02f1d5467ad05315905b9cb90307049ababb4a63 (diff) |
status --json --fast for esc
* status: Fix --json mode (only the repository lists are currently
displayed)
* status: --fast is back
Diffstat (limited to 'Messages.hs')
-rw-r--r-- | Messages.hs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Messages.hs b/Messages.hs index 6f4880e2d..d7eabccbb 100644 --- a/Messages.hs +++ b/Messages.hs @@ -20,6 +20,8 @@ module Messages ( warning, indent, maybeShowJSON, + showWith, + setupConsole ) where @@ -31,7 +33,7 @@ import qualified Annex import qualified Messages.JSON as JSON showStart :: String -> String -> Annex () -showStart command file = handle (JSON.start command file) $ +showStart command file = handle (JSON.start command $ Just file) $ flushed $ putStr $ command ++ " " ++ file ++ " " showNote :: String -> Annex () @@ -111,6 +113,16 @@ handle json normal = do maybeShowJSON :: JSON a => [(String, a)] -> Annex () maybeShowJSON v = handle (JSON.add v) q +{- Performs an a action (such as displaying something) only when + - not in json mode, and not quiet. -} +showWith :: Annex () -> Annex () +showWith a = do + output <- Annex.getState Annex.output + case output of + Annex.NormalOutput -> a + Annex.QuietOutput -> q + Annex.JSONOutput -> q + q :: Monad m => m () q = return () |