Move withoutCursor to wrap run

Why?
====

If parsing options fails, the program will exit; if
withoutCursor has been called prior to execParser, the program may exit
without any way to re-enable the cursor. This can cause confusion and
frustration for users.
This commit is contained in:
Joshua Clayton 2016-06-04 06:52:01 -04:00
parent 0505b4bff3
commit 7c26ae8e72

View File

@ -27,7 +27,7 @@ data Options = Options
}
main :: IO ()
main = withInterruptHandler $ withoutCursor $
main = withInterruptHandler $
run =<< execParser
(withInfo parseOptions pHeader pDescription pFooter)
where
@ -38,7 +38,7 @@ main = withInterruptHandler $ withoutCursor $
pFooter = "CLI USAGE: $ unused"
run :: Options -> IO ()
run options = do
run options = withoutCursor $ do
hSetBuffering stdout NoBuffering
terms' <- calculateTagInput options