diff options
author | 2016-07-26 13:30:07 -0400 | |
---|---|---|
committer | 2016-07-26 13:30:07 -0400 | |
commit | 3eb54bb464b4566e5ea5fe9db5addc20231597d0 (patch) | |
tree | 265691703d3ee1c8f64dc6accc7dd0c30fbb3c3b /Remote.hs | |
parent | 4ee3e4194a716273f68641ba0312339ab7c70b8b (diff) |
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.
Diffstat (limited to 'Remote.hs')
-rw-r--r-- | Remote.hs | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -72,6 +72,7 @@ import Remote.List import Config import Git.Types (RemoteName) import qualified Git +import Utility.JSONStream {- Map from UUIDs of Remotes to a calculated value. -} remoteMap :: (Remote -> v) -> Annex (M.Map UUID v) @@ -203,7 +204,7 @@ prettyPrintUUIDsWith -> Annex String prettyPrintUUIDsWith optfield header descm showval uuidvals = do hereu <- getUUID - maybeShowJSON [(header, map (jsonify hereu) uuidvals)] + maybeShowJSON $ JSONObject [(header, map (jsonify hereu) uuidvals)] return $ unwords $ map (\u -> "\t" ++ prettify hereu u ++ "\n") uuidvals where finddescription u = M.findWithDefault "" u descm |