[commit: ghc] master: Make ghc-pkg print less on error. (2c6939a)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2c6939a5b0b11950712be160d2712aee0e6f8b4b

>---------------------------------------------------------------

commit 2c6939a5b0b11950712be160d2712aee0e6f8b4b
Author: Ben Millwood <[email protected]>
Date:   Fri Sep 7 17:22:46 2012 +0100

    Make ghc-pkg print less on error.

>---------------------------------------------------------------

 utils/ghc-pkg/Main.hs |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index e727f4d..6e9dba6 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -98,7 +98,7 @@ main = do
            Left err -> die err
         (_,_,errors) -> do
            prog <- getProgramName
-           die (concat errors ++ usageInfo (usageHeader prog) flags)
+           die (concat errors ++ shortUsage prog)
 
 -- -----------------------------------------------------------------------------
 -- Command-line syntax
@@ -185,6 +185,9 @@ deprecFlags = [
 ourCopyright :: String
 ourCopyright = "GHC package manager version " ++ Version.version ++ "\n"
 
+shortUsage :: String -> String
+shortUsage prog = "For usage information see '" ++ prog ++ " --help'."
+
 usageHeader :: String -> String
 usageHeader prog = substProg prog $
   "Usage:\n" ++
@@ -408,11 +411,9 @@ runit verbosity cli nonopts = do
         recache verbosity cli
 
     [] -> do
-        die ("missing command\n" ++
-                usageInfo (usageHeader prog) flags)
+        die ("missing command\n" ++ shortUsage prog)
     (_cmd:_) -> do
-        die ("command-line syntax error\n" ++
-                usageInfo (usageHeader prog) flags)
+        die ("command-line syntax error\n" ++ shortUsage prog)
 
 parseCheck :: ReadP a a -> String -> String -> IO a
 parseCheck parser str what =
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.