[commit: Cabal] master: Put an explanation of the config file format at the top in comments. (dfc4e48)

Ian Lynagh igloo at earth.li
Fri Jun 24 02:02:51 CEST 2011


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

On branch  : master

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

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

commit dfc4e481d73d7ac940e96a1bbe67cfb2cd492664
Author: Duncan Coutts <duncan at haskell.org>
Date:   Sun Feb 15 19:08:17 2009 +0000

    Put an explanation of the config file format at the top in comments.

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

 cabal-install/Distribution/Client/Config.hs |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/cabal-install/Distribution/Client/Config.hs b/cabal-install/Distribution/Client/Config.hs
index 8e732ba..a47e93d 100644
--- a/cabal-install/Distribution/Client/Config.hs
+++ b/cabal-install/Distribution/Client/Config.hs
@@ -270,7 +270,19 @@ readConfigFile initial file = handleNotExists $
 writeConfigFile :: FilePath -> SavedConfig -> SavedConfig -> IO ()
 writeConfigFile file comments vals = do
   createDirectoryIfMissing True (takeDirectory file)
-  writeFile file $ showConfigWithComments comments vals ++ "\n"
+  writeFile file $ explanation ++ showConfigWithComments comments vals ++ "\n"
+  where
+    explanation = unlines
+      ["-- This is the configuration file for the 'cabal' command line tool."
+      ,""
+      ,"-- The available configuration options are listed below."
+      ,"-- Some of them have default values listed."
+      ,""
+      ,"-- Lines (like this one) beginning with '--' are comments."
+      ,"-- Be careful with spaces and indentation because they are"
+      ,"-- used to indicate layout for nested sections."
+      ,"",""
+      ]
 
 -- | These are the default values that get used in Cabal if a no value is
 -- given. We use these here to include in comments when we write out the





More information about the Cvs-libraries mailing list