diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-09-09 14:21:06 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-09-09 14:21:06 -0400 |
commit | 254479fb1b6cb1906729cda1f9fac76ddbeec4e5 (patch) | |
tree | 823b53c5f3cd35aa7ce760641385087b4e9a9ce3 /Messages.hs | |
parent | 7be4468ffa5127f539712c72e202d19a9990984b (diff) |
make maybeShowJSON also add to the buffer
Diffstat (limited to 'Messages.hs')
-rw-r--r-- | Messages.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Messages.hs b/Messages.hs index b8764be55..83f444a99 100644 --- a/Messages.hs +++ b/Messages.hs @@ -155,15 +155,11 @@ indent = intercalate "\n" . map (\l -> " " ++ l) . lines {- Shows a JSON chunk only when in json mode. -} maybeShowJSON :: JSONChunk v -> Annex () -maybeShowJSON v = withMessageState $ \s -> case outputType s of - JSONOutput -> liftIO $ JSON.add v - _ -> return () +maybeShowJSON v = void $ withMessageState $ outputJSON (JSON.add v) False {- Shows a complete JSON value, only when in json mode. -} showFullJSON :: JSONChunk v -> Annex Bool -showFullJSON v = withMessageState $ \s -> case outputType s of - JSONOutput -> liftIO $ JSON.complete v >> return True - _ -> return False +showFullJSON v = withMessageState $ outputJSON (JSON.complete v) True {- Performs an action that outputs nonstandard/customized output, and - in JSON mode wraps its output in JSON.start and JSON.end, so it's |