diff options
author | andy@galois.com <unknown> | 2007-07-11 07:24:54 +0000 |
---|---|---|
committer | andy@galois.com <unknown> | 2007-07-11 07:24:54 +0000 |
commit | 3c23b14c467a436d7fd95a80a4aceae8ea8913c7 (patch) | |
tree | b7a743eaa92e613f76a138ef5048645fd9623edc /utils/hpc/HpcFlags.hs | |
parent | 8788d157ec75d169832fc83ec456debab3158541 (diff) | |
download | haskell-3c23b14c467a436d7fd95a80a4aceae8ea8913c7.tar.gz |
Adding hpcError, that improves error messages with usage
Diffstat (limited to 'utils/hpc/HpcFlags.hs')
-rw-r--r-- | utils/hpc/HpcFlags.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/hpc/HpcFlags.hs b/utils/hpc/HpcFlags.hs index 2cbe0c19c3..38abe6315e 100644 --- a/utils/hpc/HpcFlags.hs +++ b/utils/hpc/HpcFlags.hs @@ -7,6 +7,7 @@ import Data.Maybe ( fromMaybe ) import qualified HpcSet as Set import Data.Char import Trace.Hpc.Tix +import System.Exit data Flags = Flags { outputFile :: String @@ -108,6 +109,12 @@ command_usage plugin = then "" else usageInfo "\n\nOptions:\n" (options plugin) +hpcError :: Plugin -> String -> IO a +hpcError plugin msg = do + putStrLn $ "Error: " ++ msg + command_usage plugin + exitFailure + ------------------------------------------------------------------------------- data Plugin = Plugin { name :: String |