Commit 556b9877 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Rename various *Verbose fields to *Verbosity instead

Despite appearances this is actually not completely pointless.
For the Cabal-1.4 branch we need the *Verbose fields to have the
same types as they did in Cabal-1.2, becuase lots of Setup.hs
scripts use them and our change to make them all have type Flag
makes many Setup.hs scripts fail. A solution for the 1.4 branch
is to rename the real field and to add the old field back in.
To keep as much similarity as possible between the HEAD and 1.4
branches I'm applying the name change in both.
On the plus side it's a better name anyway.
parent c4f0e7ca
......@@ -88,7 +88,7 @@ import Distribution.PackageDescription
import Distribution.Simple.Setup
import Distribution.Simple.Command
import Distribution.Simple.Utils (die, rawSystemExit, cabalVersion)
import Distribution.Simple.Utils (rawSystemExit, cabalVersion)
import Distribution.License (License(..))
import Distribution.Version
......@@ -151,7 +151,7 @@ defaultMainHelper args =
configureAction :: ConfigFlags -> [String] -> IO ()
configureAction flags args = do
noExtraFlags args
let verbosity = fromFlag (configVerbose flags)
let verbosity = fromFlag (configVerbosity flags)
rawSystemExit verbosity "sh" $
"configure"
: configureArgs backwardsCompatHack flags
......@@ -165,42 +165,42 @@ copyAction flags args = do
CopyTo path -> ["copy", "destdir=" ++ path]
CopyPrefix path -> ["install", "prefix=" ++ path]
-- CopyPrefix is backwards compat, DEPRECATED
rawSystemExit (fromFlag $ copyVerbose flags) "make" destArgs
rawSystemExit (fromFlag $ copyVerbosity flags) "make" destArgs
installAction :: InstallFlags -> [String] -> IO ()
installAction flags args = do
noExtraFlags args
rawSystemExit (fromFlag $ installVerbose flags) "make" ["install"]
rawSystemExit (fromFlag $ installVerbose flags) "make" ["register"]
rawSystemExit (fromFlag $ installVerbosity flags) "make" ["install"]
rawSystemExit (fromFlag $ installVerbosity flags) "make" ["register"]
haddockAction :: HaddockFlags -> [String] -> IO ()
haddockAction flags args = do
noExtraFlags args
rawSystemExit (fromFlag $ haddockVerbose flags) "make" ["docs"]
rawSystemExit (fromFlag $ haddockVerbosity flags) "make" ["docs"]
`catch` \_ ->
rawSystemExit (fromFlag $ haddockVerbose flags) "make" ["doc"]
rawSystemExit (fromFlag $ haddockVerbosity flags) "make" ["doc"]
buildAction :: BuildFlags -> [String] -> IO ()
buildAction flags args = do
noExtraFlags args
rawSystemExit (fromFlag $ buildVerbose flags) "make" []
rawSystemExit (fromFlag $ buildVerbosity flags) "make" []
cleanAction :: CleanFlags -> [String] -> IO ()
cleanAction flags args = do
noExtraFlags args
rawSystemExit (fromFlag $ cleanVerbose flags) "make" ["clean"]
rawSystemExit (fromFlag $ cleanVerbosity flags) "make" ["clean"]
sdistAction :: SDistFlags -> [String] -> IO ()
sdistAction flags args = do
noExtraFlags args
rawSystemExit (fromFlag $ sDistVerbose flags) "make" ["dist"]
rawSystemExit (fromFlag $ sDistVerbosity flags) "make" ["dist"]
registerAction :: RegisterFlags -> [String] -> IO ()
registerAction flags args = do
noExtraFlags args
rawSystemExit (fromFlag $ regVerbose flags) "make" ["register"]
rawSystemExit (fromFlag $ regVerbosity flags) "make" ["register"]
unregisterAction :: RegisterFlags -> [String] -> IO ()
unregisterAction flags args = do
noExtraFlags args
rawSystemExit (fromFlag $ regVerbose flags) "make" ["unregister"]
rawSystemExit (fromFlag $ regVerbosity flags) "make" ["unregister"]
......@@ -212,12 +212,12 @@ configureAction hooks flags args = do
(mb_pd_file, pkg_descr0) <- confPkgDescr
-- get_pkg_descr (configVerbose flags')
-- get_pkg_descr (configVerbosity flags')
--let pkg_descr = updatePackageDescription pbi pkg_descr0
let epkg_descr = (pkg_descr0, pbi)
--(warns, ers) <- sanityCheckPackage pkg_descr
--errorOut (configVerbose flags') warns ers
--errorOut (configVerbosity flags') warns ers
localbuildinfo0 <- confHook hooks epkg_descr flags
......@@ -228,7 +228,7 @@ configureAction hooks flags args = do
let pkg_descr = localPkgDescr localbuildinfo
postConf hooks args flags pkg_descr localbuildinfo
where
verbosity = fromFlag (configVerbose flags)
verbosity = fromFlag (configVerbosity flags)
confPkgDescr :: IO (Maybe FilePath,
Either GenericPackageDescription
PackageDescription)
......@@ -274,7 +274,7 @@ cleanAction hooks flags args = do
cleanHook hooks pkg_descr mlbi hooks flags
postClean hooks args flags pkg_descr mlbi
where verbosity = fromFlag (cleanVerbose flags)
where verbosity = fromFlag (cleanVerbosity flags)
copyAction :: UserHooks -> CopyFlags -> Args -> IO ()
copyAction = hookedAction preCopy copyHook postCopy
......@@ -296,7 +296,7 @@ sdistAction hooks flags args = do
sDistHook hooks pkg_descr mlbi hooks flags
postSDist hooks args flags pkg_descr mlbi
where verbosity = fromFlag (sDistVerbose flags)
where verbosity = fromFlag (sDistVerbosity flags)
testAction :: UserHooks -> () -> Args -> IO ()
testAction hooks _flags args = do
......@@ -372,7 +372,7 @@ clean pkg_descr flags = do
if isDir then removeDirectoryRecursive fname
else if isFile then removeFile fname
else return ()
verbosity = fromFlag (cleanVerbose flags)
verbosity = fromFlag (cleanVerbosity flags)
-- --------------------------------------------------------------------------
-- Default hooks
......@@ -412,7 +412,7 @@ simpleUserHooks =
defaultUserHooks :: UserHooks
defaultUserHooks = autoconfUserHooks {
confHook = \pkg flags -> do
let verbosity = fromFlag (configVerbose flags)
let verbosity = fromFlag (configVerbosity flags)
warn verbosity $
"defaultUserHooks in Setup script is deprecated."
confHook autoconfUserHooks pkg flags,
......@@ -422,7 +422,7 @@ defaultUserHooks = autoconfUserHooks {
-- It's here for compatability with existing Setup.hs scripts. See:
-- http://hackage.haskell.org/trac/hackage/ticket/165
where oldCompatPostConf args flags _ _
= do let verbosity = fromFlag (configVerbose flags)
= do let verbosity = fromFlag (configVerbosity flags)
noExtraFlags args
confExists <- doesFileExist "configure"
when confExists $
......@@ -434,20 +434,20 @@ autoconfUserHooks :: UserHooks
autoconfUserHooks
= simpleUserHooks
{
postConf = defaultPostConf,
preBuild = readHook buildVerbose,
preMakefile = readHook makefileVerbose,
preClean = readHook cleanVerbose,
preCopy = readHook copyVerbose,
preInst = readHook installVerbose,
preHscolour = readHook hscolourVerbose,
preHaddock = readHook haddockVerbose,
preReg = readHook regVerbose,
preUnreg = readHook regVerbose
postConf = defaultPostConf,
preBuild = readHook buildVerbosity,
preMakefile = readHook makefileVerbosity,
preClean = readHook cleanVerbosity,
preCopy = readHook copyVerbosity,
preInst = readHook installVerbosity,
preHscolour = readHook hscolourVerbosity,
preHaddock = readHook haddockVerbosity,
preReg = readHook regVerbosity,
preUnreg = readHook regVerbosity
}
where defaultPostConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
defaultPostConf args flags _ _
= do let verbosity = fromFlag (configVerbose flags)
= do let verbosity = fromFlag (configVerbosity flags)
noExtraFlags args
confExists <- doesFileExist "configure"
if confExists
......@@ -472,13 +472,13 @@ defaultInstallHook :: PackageDescription -> LocalBuildInfo
-> UserHooks -> InstallFlags -> IO ()
defaultInstallHook pkg_descr localbuildinfo _ flags = do
install pkg_descr localbuildinfo defaultCopyFlags {
copyDest = toFlag NoCopyDest,
copyVerbose = installVerbose flags
copyDest = toFlag NoCopyDest,
copyVerbosity = installVerbosity flags
}
when (hasLibs pkg_descr) $
register pkg_descr localbuildinfo defaultRegisterFlags {
regPackageDB = installPackageDB flags,
regVerbose = installVerbose flags
regPackageDB = installPackageDB flags,
regVerbosity = installVerbosity flags
}
defaultBuildHook :: PackageDescription -> LocalBuildInfo
......@@ -502,4 +502,4 @@ defaultRegHook pkg_descr localbuildinfo _ flags =
then register pkg_descr localbuildinfo flags
else setupMessage verbosity
"Package contains no library to register:" (packageId pkg_descr)
where verbosity = fromFlag (regVerbose flags)
where verbosity = fromFlag (regVerbosity flags)
......@@ -91,7 +91,7 @@ build :: PackageDescription -- ^mostly information from the .cabal file
-> [ PPSuffixHandler ] -- ^preprocessors to run before compiling
-> IO ()
build pkg_descr lbi flags suffixes = do
let verbosity = fromFlag (buildVerbose flags)
let verbosity = fromFlag (buildVerbosity flags)
initialBuildSteps pkg_descr lbi verbosity suffixes
setupMessage verbosity "Building" (packageId pkg_descr)
case compilerFlavor (compiler lbi) of
......@@ -107,7 +107,7 @@ makefile :: PackageDescription -- ^mostly information from the .cabal file
-> [ PPSuffixHandler ] -- ^preprocessors to run before compiling
-> IO ()
makefile pkg_descr lbi flags suffixes = do
let verbosity = fromFlag (makefileVerbose flags)
let verbosity = fromFlag (makefileVerbosity flags)
initialBuildSteps pkg_descr lbi verbosity suffixes
when (not (hasLibs pkg_descr)) $
die ("Makefile is only supported for libraries, currently.")
......
......@@ -258,7 +258,7 @@ configure :: ( Either GenericPackageDescription PackageDescription
, HookedBuildInfo)
-> ConfigFlags -> IO LocalBuildInfo
configure (pkg_descr0, pbi) cfg
= do let verbosity = fromFlag (configVerbose cfg)
= do let verbosity = fromFlag (configVerbosity cfg)
setupMessage verbosity "Configuring"
(packageId (either packageDescription id pkg_descr0))
......@@ -606,7 +606,7 @@ configCompilerAux cfg = configCompiler (flagToMaybe $ configHcFlavor cfg)
(flagToMaybe $ configHcPath cfg)
(flagToMaybe $ configHcPkg cfg)
defaultProgramConfiguration
(fromFlag (configVerbose cfg))
(fromFlag (configVerbosity cfg))
configCompiler :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath
-> ProgramConfiguration -> Verbosity
......
......@@ -641,7 +641,7 @@ mkGHCiLibName lib = "HS" ++ display lib <.> "o"
makefile :: PackageDescription -> LocalBuildInfo -> MakefileFlags -> IO ()
makefile pkg_descr lbi flags = do
let file = fromFlagOrDefault "Makefile"(makefileFile flags)
verbosity = fromFlag (makefileVerbose flags)
verbosity = fromFlag (makefileVerbosity flags)
targetExists <- doesFileExist file
when targetExists $
die ("Not overwriting existing copy of " ++ file)
......
......@@ -104,7 +104,7 @@ import Distribution.Version
haddock :: PackageDescription -> LocalBuildInfo -> [PPSuffixHandler] -> HaddockFlags -> IO ()
haddock pkg_descr _ _ haddockFlags
| not (hasLibs pkg_descr) && not (fromFlag $ haddockExecutables haddockFlags) =
warn (fromFlag $ haddockVerbose haddockFlags) $
warn (fromFlag $ haddockVerbosity haddockFlags) $
"No documentation was generated as this package does not contain "
++ "a library. Perhaps you want to use the haddock command with the "
++ "--executables flag."
......@@ -115,7 +115,7 @@ haddock pkg_descr lbi suffixes flags = do
when hsColour $ hscolour pkg_descr lbi suffixes defaultHscolourFlags {
hscolourCSS = haddockHscolourCss flags,
hscolourExecutables = haddockExecutables flags,
hscolourVerbose = haddockVerbose flags
hscolourVerbosity = haddockVerbosity flags
}
(confHaddock, _) <- requireProgram verbosity haddockProgram
......@@ -255,7 +255,7 @@ haddock pkg_descr lbi suffixes flags = do
removeDirectoryRecursive tmpDir
where
verbosity = fromFlag (haddockVerbose flags)
verbosity = fromFlag (haddockVerbosity flags)
mockPP inputArgs bi pref file
= do let (filePref, fileName) = splitFileName file
let targetDir = pref </> filePref
......@@ -379,7 +379,7 @@ hscolour pkg_descr lbi suffixes flags = do
Just s -> copyFile s (dir </> "hscolour.css")
doExes = fromFlag (hscolourExecutables flags)
stylesheet = flagToMaybe (hscolourCSS flags)
verbosity = fromFlag (hscolourVerbose flags)
verbosity = fromFlag (hscolourVerbosity flags)
--TODO: where to put this? it's duplicated in .Simple too
......
......@@ -80,7 +80,7 @@ install :: PackageDescription -- ^information from the .cabal file
-> CopyFlags -- ^flags sent to copy or install
-> IO ()
install pkg_descr lbi flags = do
let verbosity = fromFlag (copyVerbose flags)
let verbosity = fromFlag (copyVerbosity flags)
copydest = fromFlag (copyDest flags)
InstallDirs {
bindir = binPref,
......
......@@ -105,7 +105,7 @@ register :: PackageDescription -> LocalBuildInfo
-> IO ()
register pkg_descr lbi regFlags
| isNothing (library pkg_descr) = do
setupMessage (fromFlag $ regVerbose regFlags) "No package to register" (packageId pkg_descr)
setupMessage (fromFlag $ regVerbosity regFlags) "No package to register" (packageId pkg_descr)
return ()
| otherwise = do
let isWindows = case buildOS of Windows -> True; _ -> False
......@@ -114,7 +114,7 @@ register pkg_descr lbi regFlags
genPkgConfigDefault = display (packageId pkg_descr) <.> "conf"
genPkgConfigFile = fromMaybe genPkgConfigDefault
(fromFlag (regGenPkgConf regFlags))
verbosity = fromFlag (regVerbose regFlags)
verbosity = fromFlag (regVerbosity regFlags)
packageDB = fromFlagOrDefault (withPackageDB lbi) (regPackageDB regFlags)
inplace = fromFlag (regInPlace regFlags)
message | genPkgConf = "Writing package registration file: "
......@@ -279,7 +279,7 @@ mkInstalledPackageInfo pkg_descr lbi inplace = do
unregister :: PackageDescription -> LocalBuildInfo -> RegisterFlags -> IO ()
unregister pkg_descr lbi regFlags = do
let genScript = fromFlag (regGenScript regFlags)
verbosity = fromFlag (regVerbose regFlags)
verbosity = fromFlag (regVerbosity regFlags)
packageDB = fromFlagOrDefault (withPackageDB lbi) (regPackageDB regFlags)
installDirs = absoluteInstallDirs pkg_descr lbi NoCopyDest
setupMessage verbosity "Unregistering" (packageId pkg_descr)
......
......@@ -64,7 +64,7 @@ module Distribution.Simple.Setup (
fromFlagOrDefault,
flagToMaybe,
flagToList,
boolOpt, boolOpt', trueArg, falseArg, optionVerbose ) where
boolOpt, boolOpt', trueArg, falseArg, optionVerbosity ) where
import Distribution.Compiler ()
import Distribution.ReadE
......@@ -242,7 +242,7 @@ data ConfigFlags = ConfigFlags {
configExtraLibDirs :: [FilePath], -- ^ path to search for extra libraries
configExtraIncludeDirs :: [FilePath], -- ^ path to search for header files
configVerbose :: Flag Verbosity, -- ^verbosity level
configVerbosity :: Flag Verbosity, -- ^verbosity level
configUserInstall :: Flag Bool, -- ^The --user\/--global flag
configPackageDB :: Flag PackageDB, -- ^Which package DB to use
configGHCiLib :: Flag Bool, -- ^Enable compiling library for GHCi
......@@ -263,7 +263,7 @@ defaultConfigFlags progConf = emptyConfigFlags {
configOptimization = Flag NormalOptimisation,
configProgPrefix = Flag (toPathTemplate ""),
configProgSuffix = Flag (toPathTemplate ""),
configVerbose = Flag normal,
configVerbosity = Flag normal,
configUserInstall = Flag False, --TODO: reverse this
configGHCiLib = Flag True,
configSplitObjs = Flag False, -- takes longer, so turn off by default
......@@ -287,7 +287,7 @@ configureCommand progConf = makeCommand name shortDesc longDesc defaultFlags opt
configureOptions :: ShowOrParseArgs -> [OptionField ConfigFlags]
configureOptions showOrParseArgs =
[optionVerbose configVerbose (\v flags -> flags { configVerbose = v })
[optionVerbosity configVerbosity (\v flags -> flags { configVerbosity = v })
,option [] ["compiler"] "compiler"
configHcFlavor (\v flags -> flags { configHcFlavor = v })
......@@ -497,7 +497,7 @@ instance Monoid ConfigFlags where
configProgSuffix = mempty,
configInstallDirs = mempty,
configScratchDir = mempty,
configVerbose = mempty,
configVerbosity = mempty,
configUserInstall = mempty,
configPackageDB = mempty,
configGHCiLib = mempty,
......@@ -524,7 +524,7 @@ instance Monoid ConfigFlags where
configProgSuffix = combine configProgSuffix,
configInstallDirs = combine configInstallDirs,
configScratchDir = combine configScratchDir,
configVerbose = combine configVerbose,
configVerbosity = combine configVerbosity,
configUserInstall = combine configUserInstall,
configPackageDB = combine configPackageDB,
configGHCiLib = combine configGHCiLib,
......@@ -542,15 +542,15 @@ instance Monoid ConfigFlags where
-- | Flags to @copy@: (destdir, copy-prefix (backwards compat), verbosity)
data CopyFlags = CopyFlags {
copyDest :: Flag CopyDest,
copyVerbose :: Flag Verbosity
copyDest :: Flag CopyDest,
copyVerbosity :: Flag Verbosity
}
deriving Show
defaultCopyFlags :: CopyFlags
defaultCopyFlags = CopyFlags {
copyDest = Flag NoCopyDest,
copyVerbose = Flag normal
copyDest = Flag NoCopyDest,
copyVerbosity = Flag normal
}
copyCommand :: CommandUI CopyFlags
......@@ -562,7 +562,7 @@ copyCommand = makeCommand name shortDesc longDesc defaultCopyFlags options
"Does not call register, and allows a prefix at install time\n"
++ "Without the --destdir flag, configure determines location.\n"
options _ =
[optionVerbose copyVerbose (\v flags -> flags { copyVerbose = v })
[optionVerbosity copyVerbosity (\v flags -> flags { copyVerbosity = v })
,option "" ["destdir"]
"directory to copy files to, prepended to installation directories"
......@@ -583,12 +583,12 @@ emptyCopyFlags = mempty
instance Monoid CopyFlags where
mempty = CopyFlags {
copyDest = mempty,
copyVerbose = mempty
copyDest = mempty,
copyVerbosity = mempty
}
mappend a b = CopyFlags {
copyDest = combine copyDest,
copyVerbose = combine copyVerbose
copyDest = combine copyDest,
copyVerbosity = combine copyVerbosity
}
where combine field = field a `mappend` field b
......@@ -599,14 +599,14 @@ instance Monoid CopyFlags where
-- | Flags to @install@: (package db, verbosity)
data InstallFlags = InstallFlags {
installPackageDB :: Flag PackageDB,
installVerbose :: Flag Verbosity
installVerbosity :: Flag Verbosity
}
deriving Show
defaultInstallFlags :: InstallFlags
defaultInstallFlags = InstallFlags {
installPackageDB = NoFlag,
installVerbose = Flag normal
installVerbosity = Flag normal
}
installCommand :: CommandUI InstallFlags
......@@ -619,7 +619,7 @@ installCommand = makeCommand name shortDesc longDesc defaultInstallFlags options
++ "If you want to install into a location that is not what was\n"
++ "specified in the configure step, use the copy command.\n"
options _ =
[optionVerbose installVerbose (\v flags -> flags { installVerbose = v })
[optionVerbosity installVerbosity (\v flags -> flags { installVerbosity = v })
,option "" ["packageDB"] ""
installPackageDB (\v flags -> flags { installPackageDB = v })
......@@ -635,11 +635,11 @@ emptyInstallFlags = mempty
instance Monoid InstallFlags where
mempty = InstallFlags{
installPackageDB = mempty,
installVerbose = mempty
installVerbosity = mempty
}
mappend a b = InstallFlags{
installPackageDB = combine installPackageDB,
installVerbose = combine installVerbose
installVerbosity = combine installVerbosity
}
where combine field = field a `mappend` field b
......@@ -649,15 +649,15 @@ instance Monoid InstallFlags where
-- | Flags to @sdist@: (snapshot, verbosity)
data SDistFlags = SDistFlags {
sDistSnapshot :: Flag Bool,
sDistVerbose :: Flag Verbosity
sDistSnapshot :: Flag Bool,
sDistVerbosity :: Flag Verbosity
}
deriving Show
defaultSDistFlags :: SDistFlags
defaultSDistFlags = SDistFlags {
sDistSnapshot = Flag False,
sDistVerbose = Flag normal
sDistSnapshot = Flag False,
sDistVerbosity = Flag normal
}
sdistCommand :: CommandUI SDistFlags
......@@ -667,7 +667,7 @@ sdistCommand = makeCommand name shortDesc longDesc defaultSDistFlags options
shortDesc = "Generate a source distribution file (.tar.gz)."
longDesc = Nothing
options _ =
[optionVerbose sDistVerbose (\v flags -> flags { sDistVerbose = v })
[optionVerbosity sDistVerbosity (\v flags -> flags { sDistVerbosity = v })
,option "" ["snapshot"]
"Produce a snapshot source distribution"
......@@ -680,12 +680,12 @@ emptySDistFlags = mempty
instance Monoid SDistFlags where
mempty = SDistFlags {
sDistSnapshot = mempty,
sDistVerbose = mempty
sDistSnapshot = mempty,
sDistVerbosity = mempty
}
mappend a b = SDistFlags {
sDistSnapshot = combine sDistSnapshot,
sDistVerbose = combine sDistVerbose
sDistSnapshot = combine sDistSnapshot,
sDistVerbosity = combine sDistVerbosity
}
where combine field = field a `mappend` field b
......@@ -700,7 +700,7 @@ data RegisterFlags = RegisterFlags {
regGenScript :: Flag Bool,
regGenPkgConf :: Flag (Maybe FilePath),
regInPlace :: Flag Bool,
regVerbose :: Flag Verbosity
regVerbosity :: Flag Verbosity
}
deriving Show
......@@ -710,7 +710,7 @@ defaultRegisterFlags = RegisterFlags {
regGenScript = Flag False,
regGenPkgConf = Flag Nothing,
regInPlace = Flag False,
regVerbose = Flag normal
regVerbosity = Flag normal
}
registerCommand :: CommandUI RegisterFlags
......@@ -720,7 +720,7 @@ registerCommand = makeCommand name shortDesc longDesc defaultRegisterFlags optio
shortDesc = "Register this package with the compiler."
longDesc = Nothing
options _ =
[optionVerbose regVerbose (\v flags -> flags { regVerbose = v })
[optionVerbosity regVerbosity (\v flags -> flags { regVerbosity = v })
,option "" ["packageDB"] ""
regPackageDB (\v flags -> flags { regPackageDB = v })
......@@ -752,7 +752,7 @@ unregisterCommand = makeCommand name shortDesc longDesc defaultRegisterFlags opt
shortDesc = "Unregister this package with the compiler."
longDesc = Nothing
options _ =
[optionVerbose regVerbose (\v flags -> flags { regVerbose = v })
[optionVerbosity regVerbosity (\v flags -> flags { regVerbosity = v })
,option "" ["user"] ""
regPackageDB (\v flags -> flags { regPackageDB = v })
......@@ -776,14 +776,14 @@ instance Monoid RegisterFlags where
regGenScript = mempty,
regGenPkgConf = mempty,
regInPlace = mempty,
regVerbose = mempty
regVerbosity = mempty
}
mappend a b = RegisterFlags {
regPackageDB = combine regPackageDB,
regGenScript = combine regGenScript,
regGenPkgConf = combine regGenPkgConf,
regInPlace = combine regInPlace,
regVerbose = combine regVerbose
regVerbosity = combine regVerbosity
}
where combine field = field a `mappend` field b
......@@ -794,7 +794,7 @@ instance Monoid RegisterFlags where
data HscolourFlags = HscolourFlags {
hscolourCSS :: Flag FilePath,
hscolourExecutables :: Flag Bool,
hscolourVerbose :: Flag Verbosity
hscolourVerbosity :: Flag Verbosity
}
deriving Show
......@@ -805,19 +805,19 @@ defaultHscolourFlags :: HscolourFlags
defaultHscolourFlags = HscolourFlags {
hscolourCSS = NoFlag,
hscolourExecutables = Flag False,
hscolourVerbose = Flag normal
hscolourVerbosity = Flag normal
}
instance Monoid HscolourFlags where
mempty = HscolourFlags {
hscolourCSS = mempty,
hscolourExecutables = mempty,
hscolourVerbose = mempty
hscolourVerbosity = mempty
}
mappend a b = HscolourFlags {
hscolourCSS = combine hscolourCSS,
hscolourExecutables = combine hscolourExecutables,
hscolourVerbose = combine hscolourVerbose
hscolourVerbosity = combine hscolourVerbosity
}
where combine field = field a `mappend` field b
......@@ -828,7 +828,7 @@ hscolourCommand = makeCommand name shortDesc longDesc defaultHscolourFlags optio
shortDesc = "Generate HsColour colourised code, in HTML format."
longDesc = Just (\_ -> "Requires hscolour.")
options _ =
[optionVerbose hscolourVerbose (\v flags -> flags { hscolourVerbose = v })
[optionVerbosity hscolourVerbosity (\v flags -> flags { hscolourVerbosity = v })
,option "" ["executables"]
"Run hscolour for Executables targets"
......@@ -852,7 +852,7 @@ data HaddockFlags = HaddockFlags {
haddockCss :: Flag FilePath,
haddockHscolour :: Flag Bool,
haddockHscolourCss :: Flag FilePath,
haddockVerbose :: Flag Verbosity
haddockVerbosity :: Flag Verbosity
}
deriving Show
......@@ -864,7 +864,7 @@ defaultHaddockFlags = HaddockFlags {
haddockCss = NoFlag,
haddockHscolour = Flag False,
haddockHscolourCss = NoFlag,
haddockVerbose = Flag normal
haddockVerbosity = Flag normal
}
haddockCommand :: CommandUI HaddockFlags
......@@ -874,7 +874,7 @@ haddockCommand = makeCommand name shortDesc longDesc defaultHaddockFlags options
shortDesc = "Generate Haddock HTML documentation."
longDesc = Just (\_ -> "Requires cpphs and haddock.\n")
options _ =
[optionVerbose haddockVerbose (\v flags -> flags { haddockVerbose = v })
[optionVerbosity haddockVerbosity (\v flags -> flags { haddockVerbosity = v })
,option "" ["hoogle"]
"Generate a hoogle database"
......@@ -918,7 +918,7 @@ instance Monoid HaddockFlags where
haddockCss = mempty,
haddockHscolour = mempty,
haddockHscolourCss = mempty,
haddockVerbose = mempty
haddockVerbosity = mempty
}
mappend a b = HaddockFlags {
haddockHoogle = combine haddockHoogle,
......@@ -927,7 +927,7 @@ instance Monoid HaddockFlags where
haddockCss = combine haddockCss,
haddockHscolour = combine haddockHscolour,