fixed reading argvars from gfc in gf-to-gfcc

This commit is contained in:
aarne
2007-09-21 12:00:31 +00:00
parent 73ef8309ab
commit 0260265de0
4 changed files with 19 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ module Main where
import GF.Devel.Compile
import GF.Devel.GrammarToGFCC
import GF.Devel.UseIO
import GF.Infra.Option
---import GF.Devel.PrGrammar ---
import System
@@ -10,15 +11,16 @@ import System
main = do
xx <- getArgs
case xx of
"-help":[] -> putStrLn "usage: gfc (--make) FILES"
"--make":fs -> do
gr <- batchCompile fs
let (opts,fs) = getOptions "-" xx
case opts of
_ | oElem (iOpt "help") opts -> putStrLn "usage: gfc (--make) FILES"
_ | oElem (iOpt "-make") opts -> do
gr <- batchCompile opts fs
let name = justModuleName (last fs)
let (abs,gc) = prGrammar2gfcc name gr
let target = abs ++ ".gfcc"
writeFile target gc
putStrLn $ "wrote file " ++ target
_ -> do
mapM_ batchCompile (map return xx)
mapM_ (batchCompile opts) (map return fs)
putStrLn "Done."