summaryrefslogtreecommitdiff
path: root/src/GF.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-03-21 13:57:38 +0000
committeraarne <aarne@cs.chalmers.se>2006-03-21 13:57:38 +0000
commite7f325f975eb7e816e04d06e35e0bd6dd16776ed (patch)
tree058833498fce8fc775fb8d126bb01eab8ffbf45a /src/GF.hs
parentda61e709ad08d059f5a2a604eb98ff82a5a15e5e (diff)
unlexer bug ; "vilka" ; lib path warning ; p -lines result
Diffstat (limited to 'src/GF.hs')
-rw-r--r--src/GF.hs20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/GF.hs b/src/GF.hs
index 8fcd219b0..478a40d3f 100644
--- a/src/GF.hs
+++ b/src/GF.hs
@@ -31,11 +31,11 @@ import GF.Text.UTF8
import GF.Today (today,version)
import GF.System.Arch
-import System (getArgs,system)
+import System (getArgs,system,getEnv)
import Control.Monad (foldM,liftM)
import Data.List (nub)
--- AR 19/4/2000 -- 28/4/2005
+-- AR 19/4/2000 -- 21/3/2006
main :: IO ()
main = do
@@ -52,7 +52,8 @@ main = do
putStrLnFlush $ encodeUTF8 helpMsg
_ | opt forJava -> do
- putStrLnFlush $ encodeUTF8 welcomeMsg
+ welcome <- welcomeMsgLib
+ putStrLnFlush $ encodeUTF8 welcome
st <- useIOE st0 $
foldM (shellStateFromFiles os) st0 fs
sessionLineJ True st
@@ -77,8 +78,8 @@ main = do
if opt beSilent then return () else putStrLnFlush "</gfbatch>"
return ()
_ -> do
-
- ifNotSil $ putStrLnFlush $ welcomeMsg
+ welcome <- welcomeMsgLib
+ ifNotSil $ putStrLnFlush $ welcome
st <- useIOE st0 $
foldM (shellStateFromFiles os) st0 fs
if null fs then return () else (ifNotSil putCPU)
@@ -110,9 +111,16 @@ helpMsg = unlines [
"which suppresses all messages except the output and fatal errors."
]
-welcomeMsg =
+welcomeMsgLib = do
+ lib <- catch
+ (getEnv "GF_LIB_PATH" >>= return . ("GF_LIB_PATH is set to" +++))
+ (const (return "Warning: GF_LIB_PATH is not defined."))
+ return $ welcomeMsg lib
+
+welcomeMsg lib =
"Welcome to " ++ authorMsg ++++
"If ä and ö (umlaut letters) look strange, see 'h -coding'." ++
+ "\n" ++ lib ++
"\n\nType 'h' for help, and 'h [Command] for more detailed help.\n"
authorMsg = unlines [