summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorBen Millwood <thebenmachine+git@gmail.com>2012-09-07 17:22:46 +0100
committerIan Lynagh <ian@well-typed.com>2012-11-30 11:54:27 +0000
commit2c6939a5b0b11950712be160d2712aee0e6f8b4b (patch)
treeab177c374979ade75654f98f8d80a0a28e9927c0 /utils
parent779f10fdedbeeb31891f3f3772cbc2dfdd32e1ee (diff)
downloadhaskell-2c6939a5b0b11950712be160d2712aee0e6f8b4b.tar.gz
Make ghc-pkg print less on error.
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-pkg/Main.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index e727f4d903..6e9dba6dab 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 =