diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-01-01 16:33:05 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-01-01 16:33:05 -0400 |
commit | 6bfb6df8f614da248562b932217566731892681d (patch) | |
tree | 3173bce3970137092042fc5ef6d4b02d63f01843 /Command | |
parent | 3732d4a2673cbe5e7b4c39b7fa2c211da0689d84 (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')
-rw-r--r-- | Command/Info.hs | 5 |
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 $ |