1
0
forked from GitHub/gf-core

Honor the --name flag when generating output files. Set module name in generated Haskell modules correctly.

This commit is contained in:
bjorn
2008-06-02 15:32:01 +00:00
parent 699cf456cb
commit 1a14b51f51
4 changed files with 22 additions and 16 deletions

View File

@@ -30,8 +30,9 @@ writeOutputs opts pgf = mapM_ (\fmt -> writeOutput opts fmt pgf) (flag optOutput
writeOutput :: Options -> OutputFormat-> PGF -> IOE ()
writeOutput opts fmt pgf =
do let path = outputFilePath opts fmt (prCId (absname pgf))
s = prPGF fmt pgf
do let name = fromMaybe (prCId (absname pgf)) (moduleFlag optName opts)
path = outputFilePath opts fmt name
s = prPGF fmt pgf name
writeOutputFile path s
outputFilePath :: Options -> OutputFormat -> String -> FilePath