-config :: IO ()
-config = do
- config <- resolveProjectConfig
- case config of
- Just (ProjectConfig {
- name=n,
- description=d,
- theme=t,
- editor=e,
- commitCommand=cc
- }) -> (putStrLn "\nProject details:\n") >> (putStr . unlines $ zipWith (+++) ["Name:\t\t", "Description:\t", "Theme:\t\t", "Editor:\t\t", "Commit command:\t"] [n, d, t, e, ccc]) where
- ccc = case cc of
- Just g -> g
- Nothing -> "Not set"
- Nothing -> putStrLn "broken"
+config :: ProjectConfig -> IO ()
+config config = (putStrLn "\nProject details:\n") >> (putStr . unlines $ zipWith (+++) ["Name:\t\t", "Description:\t", "Theme:\t\t", "Editor:\t\t", "Commit command:\t"] [n, d, t, e, ccc]) where
+ n = name (config :: ProjectConfig)
+ d = description (config :: ProjectConfig)
+ t = theme (config :: ProjectConfig)
+ e = editor (config :: ProjectConfig)
+ cc = commitCommand (config :: ProjectConfig)
+ ccc = case cc of
+ Just g -> g
+ Nothing -> "Not set"