From e658e345fd225308cdf7c2c131198f85927b1dc3 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 16 Mar 2006 20:33:35 +0000 Subject: exitFailure with gf -make --- src/GF/Shell.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/GF/Shell.hs') diff --git a/src/GF/Shell.hs b/src/GF/Shell.hs index 062946649..1077616f5 100644 --- a/src/GF/Shell.hs +++ b/src/GF/Shell.hs @@ -65,6 +65,7 @@ import Data.Char (isDigit) import Data.Maybe (fromMaybe) import GF.System.Signal (runInterruptibly) +import System.Exit (exitFailure) ---- import qualified GrammarToGramlet as Gr ---- import qualified GrammarToCanonXML2 as Canon @@ -169,10 +170,16 @@ execLine :: Bool -> CommandLine -> ([String],HState) -> IO ([String],HState) execLine put (c@(co, os), arg, cs) (outps,st) = do (st',val) <- execC c (st, arg) let tr = oElem doTrace os || null cs -- option -tr leaves trace in pipe + make = oElem (iOpt "make") os + isErr = case arg of + AError _ -> True + _ -> False utf = if (oElem useUTF8 os) then encodeUTF8 else id outp = if tr then [utf (prCommandArg val)] else [] if put then mapM_ putStrLnFlush outp else return () - execs cs val (if put then [] else outps ++ outp, st') + if make && isErr + then exitFailure + else execs cs val (if put then [] else outps ++ outp, st') where execs [] arg st = return st execs (c:cs) arg st = execLine put (c, arg, cs) st -- cgit v1.2.3