From 5073ac4e7f4c24aa412ed3a3c3d719532df9f637 Mon Sep 17 00:00:00 2001 From: bjorn Date: Mon, 2 Jun 2008 15:32:01 +0000 Subject: Honor the --name flag when generating output files. Set module name in generated Haskell modules correctly. --- src-3.0/GFC.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src-3.0/GFC.hs') diff --git a/src-3.0/GFC.hs b/src-3.0/GFC.hs index 1c773630d..4e553659b 100644 --- a/src-3.0/GFC.hs +++ b/src-3.0/GFC.hs @@ -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 -- cgit v1.2.3