summaryrefslogtreecommitdiffhomepage
path: root/UI/Readline.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-17 14:28:33 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-17 14:28:33 -0400
commitf60ac335e4e827fd242ab22539adb49f26e2c319 (patch)
tree255e16e03210b9ccb6faf72b4afd29b7262f42d9 /UI/Readline.hs
parentb474ab87ae45ed77f42eb41f658a55262bd92217 (diff)
downloadkeysafe-f60ac335e4e827fd242ab22539adb49f26e2c319.tar.gz
add progress bars to restore
also, restore actually works!
Diffstat (limited to 'UI/Readline.hs')
-rw-r--r--UI/Readline.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/UI/Readline.hs b/UI/Readline.hs
index 23be2e3..ed619df 100644
--- a/UI/Readline.hs
+++ b/UI/Readline.hs
@@ -131,7 +131,7 @@ myPromptKeyId title desc l = do
putStrLn $ "Enter a number from 1 to " ++ show (length l)
prompt
-myWithProgress :: Title -> Desc -> ((Percent -> IO ()) -> IO ()) -> IO ()
+myWithProgress :: Title -> Desc -> ((Percent -> IO ()) -> IO a) -> IO a
myWithProgress title desc a = bracket_ setup teardown (a sendpercent)
where
setup = do
@@ -140,7 +140,9 @@ myWithProgress title desc a = bracket_ setup teardown (a sendpercent)
sendpercent p = do
putStr (show p ++ "% ")
hFlush stdout
- teardown = putStrLn "done"
+ teardown = do
+ putStrLn "done"
+ putStrLn ""
showTitle :: Title -> IO ()
showTitle title = do