aboutsummaryrefslogtreecommitdiff
path: root/Command/Status.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-15 00:30:00 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-15 00:30:27 -0400
commit019373f827309e4f4a1cf694a50270142e26aa6e (patch)
tree90c0897cb3f3ce5f89a395f3938376861f5e31ef /Command/Status.hs
parent6368c79fe41abc195e809340d10d2b1714188bd4 (diff)
better status output
Diffstat (limited to 'Command/Status.hs')
-rw-r--r--Command/Status.hs15
1 files changed, 6 insertions, 9 deletions
diff --git a/Command/Status.hs b/Command/Status.hs
index 2d5996507..4f7529732 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -71,12 +71,12 @@ slow_stats =
start :: CommandStart
start = do
- showStart "status" "."
- showWith $ liftIO $ putStrLn ""
fast <- Annex.getState Annex.fast
let stats = if fast then fast_stats else fast_stats ++ slow_stats
- evalStateT (mapM_ showStat stats) (StatInfo Nothing Nothing)
- next $ next $ return True
+ showCustom "status" $ do
+ evalStateT (mapM_ showStat stats) (StatInfo Nothing Nothing)
+ return True
+ stop
stat :: String -> StatState String -> Stat
stat desc a = return $ Just (desc, a)
@@ -88,11 +88,8 @@ showStat :: Stat -> StatState ()
showStat s = calc =<< s
where
calc (Just (desc, a)) = do
- r <- a -- run first, it may produce JSON
- lift . showWith $ do
- liftIO $ putStr $ desc ++ ": "
- liftIO $ hFlush stdout
- liftIO $ putStrLn r
+ (lift . showHeader) desc
+ lift . showRaw =<< a
calc Nothing = return ()
supported_backends :: Stat