allow using Aeson for streaming JSON output
Keeping Text.JSON use for now, because it seems a better fit for most of the commands, which don't use very structured JSON objects, but just output whatever fields suites them. But this lets Aeson be used when a more structured data type is available to serialize to JSON.
This commit is contained in:
parent
fdd87d8e55
commit
a030d0a8b7
10 changed files with 52 additions and 33 deletions
|
@ -66,7 +66,7 @@ start o file key = ifM (limited <||> inAnnex key)
|
|||
|
||||
showFormatted :: Maybe Utility.Format.Format -> String -> [(String, String)] -> Annex ()
|
||||
showFormatted format unformatted vars =
|
||||
unlessM (showFullJSON vars) $
|
||||
unlessM (showFullJSON $ JSONObject vars) $
|
||||
case format of
|
||||
Nothing -> liftIO $ putStrLn unformatted
|
||||
Just formatter -> liftIO $ putStr $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue