ui: fix --ignore-assertions, perhaps more
This commit is contained in:
parent
690181426d
commit
07041e1b65
@ -45,15 +45,15 @@ main = do
|
|||||||
| "help" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStr (showModeHelp uimode) >> exitSuccess
|
| "help" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStr (showModeHelp uimode) >> exitSuccess
|
||||||
| "version" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn prognameandversion >> exitSuccess
|
| "version" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn prognameandversion >> exitSuccess
|
||||||
| "binary-filename" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn (binaryfilename progname)
|
| "binary-filename" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn (binaryfilename progname)
|
||||||
| otherwise = withJournalDo' opts runBrickUi
|
| otherwise = withJournalDoUICommand opts runBrickUi
|
||||||
|
|
||||||
withJournalDo' :: UIOpts -> (UIOpts -> Journal -> IO ()) -> IO ()
|
-- XXX withJournalDo specialised for UIOpts
|
||||||
withJournalDo' opts cmd = do
|
withJournalDoUICommand :: UIOpts -> (UIOpts -> Journal -> IO ()) -> IO ()
|
||||||
-- journalFilePathFromOpts (cliopts_ opts) >>= readJournalFile Nothing >>=
|
withJournalDoUICommand uopts@UIOpts{cliopts_=copts} cmd = do
|
||||||
-- either error' (cmd opts . journalApplyAliases (aliasesFromOpts $ cliopts_ opts))
|
rulespath <- rulesFilePathFromOpts copts
|
||||||
-- XXX head should be safe for now
|
journalpath <- journalFilePathFromOpts copts
|
||||||
(head `fmap` journalFilePathFromOpts (cliopts_ opts)) >>= readJournalFile Nothing Nothing True >>=
|
ej <- readJournalFiles Nothing rulespath (not $ ignore_assertions_ copts) journalpath
|
||||||
either error' (cmd opts . journalApplyAliases (aliasesFromOpts $ cliopts_ opts))
|
either error' (cmd uopts . journalApplyAliases (aliasesFromOpts copts)) ej
|
||||||
|
|
||||||
runBrickUi :: UIOpts -> Journal -> IO ()
|
runBrickUi :: UIOpts -> Journal -> IO ()
|
||||||
runBrickUi opts j = do
|
runBrickUi opts j = do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user