Print the right usage message
authorIan Lynagh <igloo@earth.li>
Mon, 2 Jul 2007 10:26:51 +0000 (10:26 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 2 Jul 2007 10:26:51 +0000 (10:26 +0000)
The logic for printing the ghc and ghci usage messages was inverted.
However, the ghci case will never actually happen with the current code,
as we print a usage message when cli_mode == ShowUsage and choose the
ghci usage message if cli_mode == DoInteractive. This should be fixed
as part of a larger options handling overhaul.

compiler/main/Main.hs

index ec1d569..c9d723d 100644 (file)
@@ -444,8 +444,8 @@ showVersion = do
 
 showGhcUsage dflags cli_mode = do 
   let usage_path 
-       | DoInteractive <- cli_mode = ghcUsagePath dflags
-       | otherwise                 = ghciUsagePath dflags
+       | DoInteractive <- cli_mode = ghciUsagePath dflags
+       | otherwise                 = ghcUsagePath dflags
   usage <- readFile usage_path
   dump usage
   exitWith ExitSuccess