@@ -4,6 +4,7 @@
44module Idris.REPL where
55
66import Idris.AbsSyntax
7+import Idris.ASTUtils
78import Idris.Apropos (apropos)
89import Idris.REPLParser
910import Idris.ElabDecls
@@ -1032,6 +1033,8 @@ process h fn (SetOpt AutoSolve) = setAutoSolve True
10321033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
10331034process h fn (SetOpt NoBanner) = setNoBanner True
10341035process h fn (UnsetOpt NoBanner) = setNoBanner False
1036+process h fn (SetOpt WarnReach) = fmodifyState opts_idrisCmdline $ nub . (WarnReach:)
1037+process h fn (UnsetOpt WarnReach) = fmodifyState opts_idrisCmdline $ delete WarnReach
10351038
10361039process h fn (SetOpt _) = iPrintError "Not a valid option"
10371040process h fn (UnsetOpt _) = iPrintError "Not a valid option"
@@ -1255,7 +1258,13 @@ loadInputs h inputs
12551258 _ -> return ()
12561259 ist <- getIState
12571260 putIState (ist { idris_tyinfodata = tidata,
1258− idris_patdefs = patdefs }))
1261+ idris_patdefs = patdefs })
1262+
1263+ case opt getOutput opts of
1264+ [] -> performUsageAnalysis -- interactive
1265+ _ -> return [] -- batch, will be checked by the compiler
1266+
1267+ return ())
12591268 (\e -> do i <- getIState
12601269 case e of
12611270 At f e' -> do setErrSpan f
@@ -1399,10 +1408,7 @@ idrisMain opts =
13991408
14001409 ok <- noErrors
14011410 when ok $ case output of
1402− -- just do the checks
1403− [] -> performUsageAnalysis >> return ()
1404−
1405− -- the compiler will run usage analysis itself
1411+ [] -> return ()
14061412 (o:_) -> idrisCatch (process stdout "" (Compile cgn o))
14071413 (\e -> do ist <- getIState ; iputStrLn $ pshow ist e)
14081414