diff options
| author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-03 23:33:40 +0000 |
|---|---|---|
| committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-03 23:33:40 +0000 |
| commit | 6ff1e2a976c61268660da4a7cc392bb0a8cd781f (patch) | |
| tree | b81fb34f9d2b44359dece736ebb11627f983fae4 /Main.hs | |
| parent | ed4b00399778204bc589135e005620c40c988258 (diff) | |
Improved configuration options and CPP macros.
+ Now all macros that serve as flags start with a single _.
+ Added message to '-v' output about UTF-8 support.
+ Made highlighting the default. If the highlighting-kate
library is not present, cabal will deselect the option
(unless it was explicitly set).
+ Add UTF8 support to test function in Text.Pandoc.Shared.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1374 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Main.hs')
| -rw-r--r-- | Main.hs | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -41,7 +41,7 @@ import System.Console.GetOpt import Data.Maybe ( fromMaybe ) import Data.Char ( toLower ) import Prelude hiding ( putStrLn, writeFile, readFile, getContents ) -#ifdef UTF_8 +#ifdef _UTF8 import System.IO.UTF8 import System.IO ( stdout, stderr ) #else @@ -54,13 +54,17 @@ copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n" ++ "This is free software; see the source for copying conditions. There is no\n" ++ "warranty, not even for merchantability or fitness for a particular purpose." -compileOptions :: String -compileOptions = +compileInfo :: String +compileInfo = "Compiled" ++ +#ifdef _UTF8 + " with UTF-8 support" ++ +#else + " without UTF-8 support" ++ +#endif if null languages - then "\nCompiled without syntax highlighting support." - else "\nCompiled with syntax highlighting support for the following languages:\n" ++ - (unlines $ map unwords $ chunk 5 $ - map (\s -> s ++ replicate (15 - length s) ' ') languages) + then " and without syntax highlighting support." + else " and with syntax highlighting support for:\n" ++ + (unlines $ map unwords $ chunk 5 $ map (\s -> s ++ replicate (15 - length s) ' ') languages) -- | Splits a list into groups of at most n. chunk :: Int -> [a] -> [[a]] @@ -344,7 +348,7 @@ options = (NoArg (\_ -> do prg <- getProgName - hPutStrLn stderr (prg ++ " " ++ pandocVersion ++ compileOptions ++ + hPutStrLn stderr (prg ++ " " ++ pandocVersion ++ "\n" ++ compileInfo ++ copyrightMessage) exitWith $ ExitFailure 4)) "" -- "Print version" |
