From: simonpj Date: Mon, 10 Nov 2003 12:04:25 +0000 (+0000) Subject: [project @ 2003-11-10 12:04:25 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~269 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=d255dfff87648bcd4dd1d87faa8d835d358c70a2;p=ghc-hetmet.git [project @ 2003-11-10 12:04:25 by simonpj] Better error message for ghc --show-iface, with no file supplied --- diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index 0ea708b..f159b39 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -93,7 +93,7 @@ processOneArg action rest (dash_arg@('-':arg):args) = if rest /= "" then fio rest >> return args else case args of - [] -> unknownFlagErr dash_arg + [] -> missingArgErr dash_arg (arg1:args1) -> fio arg1 >> return args1 SepArg fio -> diff --git a/ghc/compiler/main/DriverUtil.hs b/ghc/compiler/main/DriverUtil.hs index d8fe68c..0896f5b 100644 --- a/ghc/compiler/main/DriverUtil.hs +++ b/ghc/compiler/main/DriverUtil.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverUtil.hs,v 1.39 2003/08/20 15:07:57 simonmar Exp $ +-- $Id: DriverUtil.hs,v 1.40 2003/11/10 12:04:25 simonpj Exp $ -- -- Utils for the driver -- @@ -101,6 +101,9 @@ unknownFlagErr f = throwDyn (UsageError ("unrecognised flag: " ++ f)) unknownFlagsErr :: [String] -> a unknownFlagsErr fs = throwDyn (UsageError ("unrecognised flags: " ++ unwords fs)) +missingArgErr :: String -> a +missingArgErr f = throwDyn (UsageError ("missing argument for flag: " ++ f)) + my_partition :: (a -> Maybe b) -> [a] -> ([(a,b)],[a]) my_partition _ [] = ([],[]) my_partition p (a:as)