summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-10-23 12:15:01 +0000
committerbringert <bringert@cs.chalmers.se>2007-10-23 12:15:01 +0000
commit1bf4df8763c923b0bf576f4bd38590a8b9105edb (patch)
tree4461e097d86af20ea3fd0f77828afd0fe4246bcf
parent9dc7843f53803af47bad6f730a8a766db9d47240 (diff)
Added --output-dir to GF.Devel.GFC.Options. Suggested by peb.
-rw-r--r--src/GF/Devel/GFC/Options.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/GF/Devel/GFC/Options.hs b/src/GF/Devel/GFC/Options.hs
index 3187ac60f..7e6fa9e19 100644
--- a/src/GF/Devel/GFC/Options.hs
+++ b/src/GF/Devel/GFC/Options.hs
@@ -74,6 +74,7 @@ data Options = Options {
optGFCDir :: FilePath,
optOutputFormats :: [OutputFormat],
optOutputFile :: Maybe FilePath,
+ optOutputDir :: FilePath,
optLibraryPath :: [FilePath],
optForceRecomp :: Bool,
optPreprocessors :: [String],
@@ -94,6 +95,7 @@ defaultOptions = Options {
optGFCDir = ".",
optOutputFormats = [FmtGFCC],
optOutputFile = Nothing,
+ optOutputDir = ".",
optLibraryPath = [],
optForceRecomp = False,
optPreprocessors = [],
@@ -134,6 +136,8 @@ optDescr =
"Abstract only: haskell, ..."]),
Option ['o'] ["output-file"] (ReqArg outFile "FILE")
"Save output in FILE (default is out.X, where X depends on output format.",
+ Option ['D'] ["output-dir"] (ReqArg outDir "DIR")
+ "Save output files (other than .gfc files) in DIR.",
Option ['i'] [] (ReqArg addLibDir "DIR") "Add DIR to the library search path.",
Option [] ["path"] (ReqArg setLibPath "DIR:DIR:...") "Set the library search path.",
Option [] ["src","force-recomp"] (NoArg (forceRecomp True))
@@ -159,6 +163,7 @@ optDescr =
gfcDir x o = return $ o { optGFCDir = x }
outFmt x o = readOutputFormat x >>= \f -> return $ o { optOutputFormats = optOutputFormats o ++ [f] }
outFile x o = return $ o { optOutputFile = Just x }
+ outDir x o = return $ o { optOutputDir = x }
addLibDir x o = return $ o { optLibraryPath = x:optLibraryPath o }
setLibPath x o = return $ o { optLibraryPath = splitSearchPath x }
forceRecomp x o = return $ o { optForceRecomp = x }