mirror of
https://github.com/joshuaclayton/unused.git
synced 2024-08-16 08:10:55 +03:00
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:
parent
0505b4bff3
commit
7c26ae8e72
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user