better display

This commit is contained in:
Joey Hess 2014-03-30 01:24:57 -04:00
parent 713a36f641
commit 13431d874c
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import Control.Applicative
import Control.Monad import Control.Monad
import System.Console.ANSI import System.Console.ANSI
import System.Exit import System.Exit
import System.IO
import Utility.Monad import Utility.Monad
import Utility.Exception import Utility.Exception
@ -77,7 +78,11 @@ ensureProperties ps = do
where where
ensure [] rs = return rs ensure [] rs = return rs
ensure (l:ls) rs = do ensure (l:ls) rs = do
putStr $ propertyDesc l ++ "... "
hFlush stdout
r <- ensureProperty l r <- ensureProperty l
clearFromCursorToLineBeginning
setCursorColumn 0
putStr $ propertyDesc l ++ "... " putStr $ propertyDesc l ++ "... "
case r of case r of
FailedChange -> do FailedChange -> do
@ -88,7 +93,7 @@ ensureProperties ps = do
putStrLn "unchanged" putStrLn "unchanged"
MadeChange -> do MadeChange -> do
setSGR [SetColor Foreground Vivid Green] setSGR [SetColor Foreground Vivid Green]
putStrLn "ok" putStrLn "done"
setSGR [] setSGR []
ensure ls (combineResult r rs) ensure ls (combineResult r rs)