Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/d757ac766c39d1120921292146fccd312b559157

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

commit d757ac766c39d1120921292146fccd312b559157
Author: Duncan Coutts <[email protected]>
Date:   Mon Dec 17 18:59:12 2007 +0000

    Add command listing support
    first step to shell command line completion

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

 cabal-install/Main.hs |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/cabal-install/Main.hs b/cabal-install/Main.hs
index 16a893e..57b6ba0 100644
--- a/cabal-install/Main.hs
+++ b/cabal-install/Main.hs
@@ -43,17 +43,20 @@ mainWorker :: Args -> IO ()
 mainWorker args = 
   case commandsRun globalCommand commands args of
     CommandHelp   help                 -> printHelp help
+    CommandList   opts                 -> printOptionsList opts
     CommandErrors errs                 -> printErrors errs
     CommandReadyToGo (flags, commandParse)  ->
       case commandParse of
         _ | fromFlag (globalVersion flags)        -> printVersion
           | fromFlag (globalNumericVersion flags) -> printNumericVersion
         CommandHelp     help           -> printHelp help
+        CommandList     opts           -> printOptionsList opts
         CommandErrors   errs           -> printErrors errs
         CommandReadyToGo action        -> action
 
   where
     printHelp help = getProgName >>= putStr . help
+    printOptionsList = putStr . unlines
     printErrors errs = do
       putStr (concat (intersperse "\n" errs))
       exitWith (ExitFailure 1)



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to