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:
Joey Hess 2016-07-26 13:30:07 -04:00
commit a030d0a8b7
Failed to extract signature
10 changed files with 52 additions and 33 deletions

View file

@ -43,7 +43,7 @@ displayStatus s = do
let c = statusChar s
absf <- fromRepo $ fromTopFilePath (statusFile s)
f <- liftIO $ relPathCwdToFile absf
unlessM (showFullJSON [("status", [c]), ("file", f)]) $
unlessM (showFullJSON $ JSONObject [("status", [c]), ("file", f)]) $
liftIO $ putStrLn $ [c] ++ " " ++ f
-- Git thinks that present direct mode files are typechanged.