Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/2c6939a5b0b11950712be160d2712aee0e6f8b4b >--------------------------------------------------------------- commit 2c6939a5b0b11950712be160d2712aee0e6f8b4b Author: Ben Millwood <thebenmachine+...@gmail.com> 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 = _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc