[commit: Cabal] master: Only print the config file location for the global --help (c946b7b)
Ian Lynagh
igloo at earth.li
Fri Jun 24 02:02:04 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/c946b7b39b3ee1c856350578bec24c57807c74c4
>---------------------------------------------------------------
commit c946b7b39b3ee1c856350578bec24c57807c74c4
Author: Duncan Coutts <duncan at haskell.org>
Date: Fri Jan 16 17:59:00 2009 +0000
Only print the config file location for the global --help
>---------------------------------------------------------------
cabal-install/Main.hs | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cabal-install/Main.hs b/cabal-install/Main.hs
index e07a9a9..6cd2450 100644
--- a/cabal-install/Main.hs
+++ b/cabal-install/Main.hs
@@ -80,20 +80,23 @@ mainWorker :: [String] -> IO ()
mainWorker ("win32selfupgrade":args) = win32SelfUpgradeAction args
mainWorker args =
case commandsRun globalCommand commands args of
- CommandHelp help -> printHelp help
+ CommandHelp help -> printGlobalHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo (globalflags, commandParse) ->
case commandParse of
_ | fromFlag (globalVersion globalflags) -> printVersion
| fromFlag (globalNumericVersion globalflags) -> printNumericVersion
- CommandHelp help -> printHelp help
+ CommandHelp help -> printCommandHelp help
CommandList opts -> printOptionsList opts
CommandErrors errs -> printErrors errs
CommandReadyToGo action -> action globalflags
where
- printHelp help = do
+ printCommandHelp help = do
+ pname <- getProgName
+ putStr (help pname)
+ printGlobalHelp help = do
pname <- getProgName
configFile <- defaultConfigFile
putStr (help pname)
More information about the Cvs-libraries
mailing list