Commit 82373c76 authored by Joachim Breitner's avatar Joachim Breitner Committed by pcapriotti
Browse files

Give suggestions for unrecognised command line arguments

parent 8240843d
......@@ -791,5 +791,10 @@ abiHash strs = do
-- Util
unknownFlagsErr :: [String] -> a
unknownFlagsErr fs = ghcError (UsageError ("unrecognised flags: " ++ unwords fs))
unknownFlagsErr fs = ghcError $ UsageError $ concatMap oneError fs
where
oneError f =
"unrecognised flag: " ++ f ++ "\n" ++
(case fuzzyMatch f (nub allFlags) of
[] -> ""
suggs -> "did you mean one of:\n" ++ unlines (map (" " ++) suggs))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment