X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverFlags.hs;h=b2db529e5738600026b764e7ee3210ba2f447f19;hb=58eba7cdb39ad4a9ddd23eeaf2bb76a561aa813d;hp=701f2ba586e4b54269f5b366bdfc728c1fa87504;hpb=98688c6e8fd33f31c51218cf93cbf03fe3a5e73d;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index 701f2ba..b2db529 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -1,9 +1,8 @@ ----------------------------------------------------------------------------- --- $Id: DriverFlags.hs,v 1.127 2003/10/09 11:58:56 simonpj Exp $ -- -- Driver flags -- --- (c) Simon Marlow 2000 +-- (c) The University of Glasgow 2000-2003 -- ----------------------------------------------------------------------------- @@ -94,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 -> @@ -280,13 +279,13 @@ static_flags = ------- Specific phases -------------------------------------------- , ( "pgmL" , HasArg setPgmL ) , ( "pgmP" , HasArg setPgmP ) - , ( "pgmP" , HasArg setPgmP ) , ( "pgmF" , HasArg setPgmF ) , ( "pgmc" , HasArg setPgmc ) , ( "pgmm" , HasArg setPgmm ) , ( "pgms" , HasArg setPgms ) , ( "pgma" , HasArg setPgma ) , ( "pgml" , HasArg setPgml ) + , ( "pgmdll" , HasArg setPgmDLL ) #ifdef ILX , ( "pgmI" , HasArg setPgmI ) , ( "pgmi" , HasArg setPgmi ) @@ -651,7 +650,24 @@ setVerbosity n addCmdlineHCInclude a = updDynFlags (\s -> s{cmdlineHcIncludes = a : cmdlineHcIncludes s}) +-- ----------------------------------------------------------------------------- +-- Version and usage messages + showVersion :: IO () showVersion = do putStrLn (cProjectName ++ ", version " ++ cProjectVersion) exitWith ExitSuccess + +showGhcUsage = do + (ghc_usage_path,ghci_usage_path) <- getUsageMsgPaths + mode <- readIORef v_GhcMode + let usage_path + | mode == DoInteractive = ghci_usage_path + | otherwise = ghc_usage_path + usage <- readFile usage_path + dump usage + exitWith ExitSuccess + where + dump "" = return () + dump ('$':'$':s) = hPutStr stderr progName >> dump s + dump (c:s) = hPutChar stderr c >> dump s