diff options
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs index 810c227e..cde7790c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -242,7 +242,7 @@ render flags ifaces installedIfaces = do getDataDir -- provided by Cabal #endif fs -> return (last fs) - + let unicode = Flag_UseUnicode `elem` flags let css_file = case [str | Flag_CSS str <- flags] of [] -> Nothing fs -> Just (last fs) @@ -300,7 +300,7 @@ render flags ifaces installedIfaces = do ppHtml title packageStr visibleIfaces odir prologue maybe_html_help_format maybe_source_urls maybe_wiki_urls - maybe_contents_url maybe_index_url + maybe_contents_url maybe_index_url unicode copyHtmlBits odir libDir css_file when (Flag_Hoogle `elem` flags) $ do @@ -425,6 +425,9 @@ handleEasyFlags flags = do when (Flag_Version `elem` flags) byeVersion when (Flag_GhcVersion `elem` flags) byeGhcVersion + when (Flag_UseUnicode `elem` flags && not (Flag_Html `elem` flags)) $ + throwE ("Unicode can only be enabled for HTML output.") + when ((Flag_GenIndex `elem` flags || Flag_GenContents `elem` flags) && Flag_Html `elem` flags) $ throwE ("-h cannot be used with --gen-index or --gen-contents") |