aboutsummaryrefslogtreecommitdiff
path: root/Command/Info.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-01 16:33:05 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-01 16:33:05 -0400
commit6bfb6df8f614da248562b932217566731892681d (patch)
tree3173bce3970137092042fc5ef6d4b02d63f01843 /Command/Info.hs
parent3732d4a2673cbe5e7b4c39b7fa2c211da0689d84 (diff)
info --json: Improve json for "backend usage", using a nested object with fields for each backend instead of the previous weird nested lists. This may break existing parsers of this json output, if there were any.
Diffstat (limited to 'Command/Info.hs')
-rw-r--r--Command/Info.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Command/Info.hs b/Command/Info.hs
index 763279612..cb55602a6 100644
--- a/Command/Info.hs
+++ b/Command/Info.hs
@@ -12,7 +12,6 @@ module Command.Info where
import "mtl" Control.Monad.State.Strict
import qualified Data.Map.Strict as M
import Text.JSON
-import Data.Tuple
import Data.Ord
import Common.Annex
@@ -403,9 +402,9 @@ disk_size = simpleStat "available local disk space" $
backend_usage :: Stat
backend_usage = stat "backend usage" $ json fmt $
- sort . M.toList . backendsKeys <$> cachedReferencedData
+ toJSObject . sort . M.toList . backendsKeys <$> cachedReferencedData
where
- fmt = multiLine . map (\(n, b) -> b ++ ": " ++ show n) . map swap
+ fmt = multiLine . map (\(b, n) -> b ++ ": " ++ show n) . fromJSObject
numcopies_stats :: Stat
numcopies_stats = stat "numcopies stats" $ json fmt $