Show yaml representation when dumping config
parent
1a70e4d949
commit
6011726389
|
@ -99,7 +99,7 @@ mainCmdParser = do
|
||||||
Nothing -> System.Exit.exitWith (System.Exit.ExitFailure 50)
|
Nothing -> System.Exit.exitWith (System.Exit.ExitFailure 50)
|
||||||
Just x -> return x
|
Just x -> return x
|
||||||
when (confUnpack $ _dconf_dump_config $ _conf_debug $ config) $ do
|
when (confUnpack $ _dconf_dump_config $ _conf_debug $ config) $ do
|
||||||
trace (showTree config) $ return ()
|
trace (showConfigYaml config) $ return ()
|
||||||
let ghcOptions = config
|
let ghcOptions = config
|
||||||
& _conf_forward
|
& _conf_forward
|
||||||
& _options_ghc
|
& _options_ghc
|
||||||
|
|
|
@ -8,6 +8,7 @@ module Language.Haskell.Brittany.Config
|
||||||
, configParser
|
, configParser
|
||||||
, staticDefaultConfig
|
, staticDefaultConfig
|
||||||
, readMergePersConfig
|
, readMergePersConfig
|
||||||
|
, showConfigYaml
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
|
@ -177,3 +178,8 @@ readMergePersConfig path shouldCreate conf = do
|
||||||
return $ conf
|
return $ conf
|
||||||
| otherwise -> do
|
| otherwise -> do
|
||||||
return conf
|
return conf
|
||||||
|
|
||||||
|
showConfigYaml :: Config -> String
|
||||||
|
showConfigYaml = Data.ByteString.Char8.unpack
|
||||||
|
. Data.Yaml.encode
|
||||||
|
. cMap (\(Identity x) -> Just x)
|
||||||
|
|
Loading…
Reference in New Issue