aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Options.hs
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2012-04-01 21:26:13 +0200
committerDavid Waern <david.waern@gmail.com>2012-04-01 21:26:13 +0200
commit7569db9bae4e70416b960d54d145312e0b8747a2 (patch)
tree2bb27dfe0e40b2e09e5bbe9126b881bd27620419 /src/Haddock/Options.hs
parent7e3eb8d3aa0d5ff2caa62bde637d8c577b72f92d (diff)
parent29861370dd56f59557c3bcecd53fba0f88a89792 (diff)
Merge http://code.haskell.org/~thielema/haddock/ into ghc-7.4
Diffstat (limited to 'src/Haddock/Options.hs')
-rw-r--r--src/Haddock/Options.hs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Haddock/Options.hs b/src/Haddock/Options.hs
index 4e42fd32..537bffac 100644
--- a/src/Haddock/Options.hs
+++ b/src/Haddock/Options.hs
@@ -229,13 +229,16 @@ 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
+ [arg] -> Left $ "unknown qualification type " ++ show arg
+ _:_ -> Left "qualification option given multiple times"
verbosity :: [Flag] -> Verbosity