summaryrefslogtreecommitdiff
path: root/ghc/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/Main.hs')
-rw-r--r--ghc/Main.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index bda5cd9ef9..ad975d1840 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -762,11 +762,13 @@ showUsage ghci dflags = do
let usage_path = if ghci then ghciUsagePath dflags
else ghcUsagePath dflags
usage <- readFile usage_path
- dump usage
+ progName <- getProgName
+ dump progName usage
where
- dump "" = return ()
- dump ('$':'$':s) = putStr progName >> dump s
- dump (c:s) = putChar c >> dump s
+ dump progName xs = case xs of
+ "" -> return ()
+ '$':'$':s -> putStr progName >> dump progName s
+ c:s -> putChar c >> dump progName s
dumpFinalStats :: Logger -> IO ()
dumpFinalStats logger = do