summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-10-23 12:19:11 +0000
committerbringert <bringert@cs.chalmers.se>2007-10-23 12:19:11 +0000
commit5b7f45c7e6a60c655184c7a365fdceb5f591d389 (patch)
treeb663489b9d2d81a0537494c8eca5d8a6e0147856 /src
parent1bf4df8763c923b0bf576f4bd38590a8b9105edb (diff)
Added --output-name to GF.Devel.GFC.Options. Inspired by peb's --output-base suggestion.
Diffstat (limited to 'src')
-rw-r--r--src/GF/Devel/GFC/Options.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/GF/Devel/GFC/Options.hs b/src/GF/Devel/GFC/Options.hs
index 7e6fa9e19..3d8407cf2 100644
--- a/src/GF/Devel/GFC/Options.hs
+++ b/src/GF/Devel/GFC/Options.hs
@@ -73,6 +73,7 @@ data Options = Options {
optEmitGFC :: Bool,
optGFCDir :: FilePath,
optOutputFormats :: [OutputFormat],
+ optOutputName :: Maybe String,
optOutputFile :: Maybe FilePath,
optOutputDir :: FilePath,
optLibraryPath :: [FilePath],
@@ -94,6 +95,7 @@ defaultOptions = Options {
optEmitGFC = True,
optGFCDir = ".",
optOutputFormats = [FmtGFCC],
+ optOutputName = Nothing,
optOutputFile = Nothing,
optOutputDir = ".",
optLibraryPath = [],
@@ -134,6 +136,10 @@ optDescr =
"Multiple concrete: gfcc (default), gar, js, ...",
"Single concrete only: cf, bnf, lbnf, gsl, srgs_xml, srgs_abnf, ...",
"Abstract only: haskell, ..."]),
+ Option ['n'] ["output-name"] (ReqArg outName "NAME")
+ ("Use NAME as the name of the output. This is used in the output file names, "
+ ++ "with suffixes depending on the formats, and, when relevant, "
+ ++ "internally in the output."),
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")
@@ -162,6 +168,7 @@ optDescr =
emitGFC x o = return $ o { optEmitGFC = x }
gfcDir x o = return $ o { optGFCDir = x }
outFmt x o = readOutputFormat x >>= \f -> return $ o { optOutputFormats = optOutputFormats o ++ [f] }
+ outName x o = return $ o { optOutputName = Just x }
outFile x o = return $ o { optOutputFile = Just x }
outDir x o = return $ o { optOutputDir = x }
addLibDir x o = return $ o { optLibraryPath = x:optLibraryPath o }