Show yaml representation when dumping config

pull/3/head
Lennart Spitzner 2016-08-08 17:46:02 +02:00
parent 1a70e4d949
commit 6011726389
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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)