aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-07-19 20:38:26 +0100
committerIan Lynagh <igloo@earth.li>2012-07-19 20:38:26 +0100
commit7f164839d8b0b6e53fa0f15d2a6810ca310e337d (patch)
tree34a2bdeb25673b73d3a6935ab5d4170f94bc11a0 /src/Haddock/Options.hs
parent4dc9ecd3905f75adb6bcfb818fbc163c724d4545 (diff)
parent6e8bc1dca77bbbc5743f63a2e8ea5b1eab0ed80c (diff)
Merge branch 'master' of darcs.haskell.org:/srv/darcs//haddock
Diffstat (limited to 'src/Haddock/Options.hs')
-rw-r--r--src/Haddock/Options.hs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Haddock/Options.hs b/src/Haddock/Options.hs
index 4e42fd32..46f9def7 100644
--- a/src/Haddock/Options.hs
+++ b/src/Haddock/Options.hs
@@ -126,7 +126,7 @@ options backwardsCompat =
Option ['t'] ["title"] (ReqArg Flag_Heading "TITLE")
"page heading",
Option ['q'] ["qual"] (ReqArg Flag_Qualification "QUAL")
- "qualification of names, one of \n'none' (default), 'full', 'local'\nor 'relative'",
+ "qualification of names, one of \n'none' (default), 'full', 'local'\n'relative' or 'aliased'",
Option ['?'] ["help"] (NoArg Flag_Help)
"display this help and exit",
Option ['V'] ["version"] (NoArg Flag_Version)
@@ -229,13 +229,17 @@ optLaTeXStyle :: [Flag] -> Maybe String
optLaTeXStyle flags = optLast [ str | Flag_LaTeXStyle str <- flags ]
-qualification :: [Flag] -> Qualification
+qualification :: [Flag] -> Either String QualOption
qualification flags =
case map (map Char.toLower) [ str | Flag_Qualification str <- flags ] of
- "full":_ -> FullQual
- "local":_ -> LocalQual Nothing
- "relative":_ -> RelativeQual Nothing
- _ -> NoQual
+ [] -> Right OptNoQual
+ ["none"] -> Right OptNoQual
+ ["full"] -> Right OptFullQual
+ ["local"] -> Right OptLocalQual
+ ["relative"] -> Right OptRelativeQual
+ ["aliased"] -> Right OptAliasedQual
+ [arg] -> Left $ "unknown qualification type " ++ show arg
+ _:_ -> Left "qualification option given multiple times"
verbosity :: [Flag] -> Verbosity