From 1142d18a08cb8b9b96aefbd52fdadb05cb1982c7 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 13 Aug 2004 20:46:54 +0000 Subject: [PATCH] -s --- src/GF/Compile/Compile.hs | 3 ++- src/GF/Infra/ReadFiles.hs | 5 +++-- src/GF/Infra/UseIO.hs | 2 +- src/GF/Shell/Commands.hs | 5 +++-- src/GF/Shell/JGF.hs | 2 +- src/GF/UseGrammar/Session.hs | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs index b0f9bb581..5ca8d71b4 100644 --- a/src/GF/Compile/Compile.hs +++ b/src/GF/Compile/Compile.hs @@ -84,11 +84,12 @@ compileModule opts st0 file | compileModule opts1 st0 file = do opts0 <- ioeIO $ getOptionsFromFile file let useFileOpt = maybe False (const True) $ getOptVal opts0 pathList + let useLineOpt = maybe False (const True) $ getOptVal opts1 pathList let opts = addOptions opts1 opts0 let fpath = justInitPath file let ps0 = pathListOpts opts fpath - let ps1 = if useFileOpt + let ps1 = if (useFileOpt && not useLineOpt) then (map (prefixPathName fpath) ps0) else ps0 ps <- ioeIO $ extendPathEnv gfGrammarPathVar ps1 diff --git a/src/GF/Infra/ReadFiles.hs b/src/GF/Infra/ReadFiles.hs index edbed4047..683eef04d 100644 --- a/src/GF/Infra/ReadFiles.hs +++ b/src/GF/Infra/ReadFiles.hs @@ -35,8 +35,9 @@ getAllFiles opts ps env file = do -- read module headers from all files recursively ds0 <- getImports ps file let ds = [((snd m,map fst ms),p) | ((m,ms),p) <- ds0] - ioeIO $ putStrLn $ "all modules:" +++ show (map (fst . fst) ds) - + if oElem beSilent opts + then return () + else ioeIO $ putStrLn $ "all modules:" +++ show (map (fst . fst) ds) -- get a topological sorting of files: returns file names --- deletes paths ds1 <- ioeErr $ either return diff --git a/src/GF/Infra/UseIO.hs b/src/GF/Infra/UseIO.hs index 3dc41fadc..d06904297 100644 --- a/src/GF/Infra/UseIO.hs +++ b/src/GF/Infra/UseIO.hs @@ -208,7 +208,7 @@ putStrE = ioeIO . putStrFlush putPointE :: Options -> String -> IOE a -> IOE a putPointE opts msg act = do - let ve x = if oElem beVerbose opts then x else return () + let ve x = if oElem beSilent opts then return () else x ve $ ioeIO $ putStrFlush msg a <- act --- ve $ ioeIO $ putShow' id a --- replace by a statistics command diff --git a/src/GF/Shell/Commands.hs b/src/GF/Shell/Commands.hs index adc023a3d..4b0b3f82d 100644 --- a/src/GF/Shell/Commands.hs +++ b/src/GF/Shell/Commands.hs @@ -126,11 +126,11 @@ execCommand env c s = case c of -- these commands do need IO CCEnvImport file -> useIOE (env,s) $ do - st <- shellStateFromFiles opts env file + st <- shellStateFromFiles optss env file return (st,s) CCEnvEmptyAndImport file -> useIOE (emptyShellState, initSState) $ do - st <- shellStateFromFiles opts emptyShellState file + st <- shellStateFromFiles optss emptyShellState file return (startEditEnv st,initSState) CCEnvEmpty -> do @@ -180,6 +180,7 @@ execCommand env c s = case c of gr = grammarCEnv env cgr = canCEnv env opts = globalOptions env + optss = addOption beSilent opts -- format for documents: -- GF commands of form "-- command", then term or text diff --git a/src/GF/Shell/JGF.hs b/src/GF/Shell/JGF.hs index f1ed6bfb7..916d0fafd 100644 --- a/src/GF/Shell/JGF.hs +++ b/src/GF/Shell/JGF.hs @@ -21,7 +21,7 @@ import UTF8 sessionLineJ :: Bool -> ShellState -> IO () sessionLineJ isNew env = do putStrLnFlush $ initEditMsgJavaX env - let env' = addGlobalOptions (options [sizeDisplay "short"]) env + let env' = addGlobalOptions (options [sizeDisplay "short",beSilent]) env editLoopJnewX isNew env' (initSState) -- this is the real version, with XML diff --git a/src/GF/UseGrammar/Session.hs b/src/GF/UseGrammar/Session.hs index 7d43ea33c..8bc91e145 100644 --- a/src/GF/UseGrammar/Session.hs +++ b/src/GF/UseGrammar/Session.hs @@ -17,7 +17,7 @@ type SState = [(State,([Exp],[Clip]),SInfo)] -- exps: candidate refinements,clip type SInfo = ([String],(Int,Options)) -- string is message, int is the view initSState :: SState -initSState = [(initState, ([],[]), (["Select category to start"],(0,noOptions)))] +initSState = [(initState, ([],[]), (["Select 'New' category to start"],(0,noOptions)))] -- instead of empty type Clip = Tree ---- (Exp,Type)