-----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.3 2000/10/11 15:26:18 simonmar Exp $
+-- $Id: DriverUtil.hs,v 1.7 2000/11/16 11:39:37 simonmar Exp $
--
-- Utils for the driver
--
short_usage = "Usage: For basic information, try the `--help' option."
-GLOBAL_VAR(path_usage, "", String)
+GLOBAL_VAR(v_Path_usage, "", String)
long_usage = do
- usage_path <- readIORef path_usage
+ usage_path <- readIORef v_Path_usage
usage <- readFile usage_path
dump usage
exitWith ExitSuccess
dump ('$':'$':s) = hPutStr stderr get_prog_name >> dump s
dump (c:s) = hPutChar stderr c >> dump s
-version_str = cProjectVersion
-
data BarfKind
= PhaseFailed String ExitCode
| Interrupted
| OtherError String -- just prints the error message
deriving Eq
-GLOBAL_VAR(prog_name, "ghc", String)
+GLOBAL_VAR(v_Prog_name, "ghc", String)
-get_prog_name = unsafePerformIO (readIORef prog_name) -- urk!
+get_prog_name = unsafePerformIO (readIORef v_Prog_name) -- urk!
instance Show BarfKind where
showsPrec _ e = showString get_prog_name . showString ": " . showBarf e
remove_spaces :: String -> String
remove_spaces = reverse . dropWhile isSpace . reverse . dropWhile isSpace
-
-booter_version
- = case "\
- \ __GLASGOW_HASKELL__" of
- ' ':n:ns -> n:'.':ns
- ' ':m -> m
-