Skip to content
Snippets Groups Projects
Commit d5448938 authored by chrg's avatar chrg
Browse files

Small changes

parent 686e8918
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,14 @@ run = do ...@@ -69,6 +69,14 @@ run = do
, value Exp , value Exp
] ]
verbose <-
flag False True $
fold
[ long "verbose"
, short 'v'
, help "log more"
]
checkmode <- checkmode <-
flag False True $ flag False True $
fold fold
...@@ -137,7 +145,11 @@ run = do ...@@ -137,7 +145,11 @@ run = do
<> fmtMessage m <> fmtMessage m
) )
usingLoggerT (filterBySeverity Info msgSeverity $ cmapM fmt logTextStderr) do let logger =
filterBySeverity (if verbose then Debug else Info) msgSeverity $
cmapM fmt logTextStderr
usingLoggerT logger do
counter <- liftIO (newIORef (0 :: Int)) counter <- liftIO (newIORef (0 :: Int))
let let
...@@ -157,11 +169,11 @@ run = do ...@@ -157,11 +169,11 @@ run = do
removeFile (f <.> "bak") removeFile (f <.> "bak")
liftIO exitFailure liftIO exitFailure
check check ::
:: FilePath FilePath ->
-> [RPath.AnnotatedChoice (String, C.Position)] [RPath.AnnotatedChoice (String, C.Position)] ->
-> C.CTranslationUnit C.NodeInfo C.CTranslationUnit C.NodeInfo ->
-> LoggerT (Msg Severity) IO Bool LoggerT (Msg Severity) IO Bool
check f l c = process D "Checking predictate" do check f l c = process D "Checking predictate" do
let xs = NE.nonEmpty (filter ((RPath.Yes ==) . RPath.choice) l) let xs = NE.nonEmpty (filter ((RPath.Yes ==) . RPath.choice) l)
let decided = length l - RPath.numberOfUndecided l let decided = length l - RPath.numberOfUndecided l
...@@ -241,7 +253,7 @@ run = do ...@@ -241,7 +253,7 @@ run = do
unless t do unless t do
logError "file did not satisfy predicate" logError "file did not satisfy predicate"
cleanup file liftIO exitFailure
when checkmode do when checkmode do
logInfo "In checking mode, stopping now" logInfo "In checking mode, stopping now"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment