aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
authorHenning Thielemann <git@henning-thielemann.de>2012-04-01 16:25:02 +0200
committerHenning Thielemann <git@henning-thielemann.de>2012-04-01 16:25:02 +0200
commit29861370dd56f59557c3bcecd53fba0f88a89792 (patch)
tree2420d1f3ee58169646a4919ff0e3ed510cef668a /src/Haddock
parenta2bcbcffde1e78a6031132bdf4a1a605978352a8 (diff)
emit an error message when the --qual option is used incorrectly
Diffstat (limited to 'src/Haddock')
-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 3292ba16..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] -> QualOption
+qualification :: [Flag] -> Either String QualOption
qualification flags =
case map (map Char.toLower) [ str | Flag_Qualification str <- flags ] of
- "full":_ -> OptFullQual
- "local":_ -> OptLocalQual
- "relative":_ -> OptRelativeQual
- _ -> OptNoQual
+ [] -> 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