@@ -4,6 +4,7 @@
4module Idris.REPL where
4module Idris.REPL where
6import Idris.AbsSyntax
6import Idris.AbsSyntax
7import Idris.Apropos (apropos)
8import Idris.Apropos (apropos)
8import Idris.REPLParser
9import Idris.REPLParser
9import Idris.ElabDecls
10import Idris.ElabDecls
@@ -1032,6 +1033,8 @@ process h fn (SetOpt AutoSolve) = setAutoSolve True
1032process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1033process h fn (SetOpt NoBanner) = setNoBanner True
1034process h fn (SetOpt NoBanner) = setNoBanner True
1034process h fn (UnsetOpt NoBanner) = setNoBanner False
1035process 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
1036process h fn (SetOpt _) = iPrintError "Not a valid option"
1039process h fn (SetOpt _) = iPrintError "Not a valid option"
1037process h fn (UnsetOpt _) = iPrintError "Not a valid option"
1040process h fn (UnsetOpt _) = iPrintError "Not a valid option"
@@ -1255,7 +1258,13 @@ loadInputs h inputs
1255 _ -> return ()
1258 _ -> return ()
1256 ist <- getIState
1259 ist <- getIState
1257 putIState (ist { idris_tyinfodata = tidata,
1260 putIState (ist { idris_tyinfodata = tidata,
1258− idris_patdefs = patdefs }))
1261+ idris_patdefs = patdefs })
1263+ case opt getOutput opts of
1264+ [] -> performUsageAnalysis -- interactive
1265+ _ -> return [] -- batch, will be checked by the compiler
1259 (\e -> do i <- getIState
1268 (\e -> do i <- getIState
1260 case e of
1269 case e of
1261 At f e' -> do setErrSpan f
1270 At f e' -> do setErrSpan f
@@ -1399,10 +1408,7 @@ idrisMain opts =
1400 ok <- noErrors
1409 ok <- noErrors
1401 when ok $ case output of
1410 when ok $ case output of
1402− -- just do the checks
1411+ [] -> return ()
1403− [] -> performUsageAnalysis >> return ()
1405− -- the compiler will run usage analysis itself
1406 (o:_) -> idrisCatch (process stdout "" (Compile cgn o))
1412 (o:_) -> idrisCatch (process stdout "" (Compile cgn o))
1407 (\e -> do ist <- getIState ; iputStrLn $ pshow ist e)
1413 (\e -> do ist <- getIState ; iputStrLn $ pshow ist e)