Commit 0bf79ca3 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Write out Bool config values correctly

Used by cabal-install when writing the default ~/.cabal/config file.
Previously it was using show for type Maybe Bool and writing out
"Just True" when of course it should just be "True".
parent 1c916b3e
......@@ -85,7 +85,7 @@ import Data.Maybe
import Data.Monoid
import qualified Distribution.GetOpt as GetOpt
import Distribution.Text
( Text(parse) )
( Text(disp, parse) )
import Distribution.ParseUtils
import Distribution.ReadE
import Distribution.Simple.Utils (die, intercalate)
......@@ -254,7 +254,7 @@ viewAsFieldDescr (OptionField n dd) = FieldDescr n get set
ChoiceOpt alts ->
fromMaybe empty $ listToMaybe
[ text lf | (_,(_,lf:_), _,enabled) <- alts, enabled t]
BoolOpt _ _ _ _ enabled -> (text . show . enabled) t
BoolOpt _ _ _ _ enabled -> (maybe empty disp . enabled) t
set line val a =
case optDescr of
ReqArg _ _ _ readE _ -> ($ a) `liftM` runE line n readE val
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment