Reformat stackage.hs in tibbe style

@snoyberg Not bad, ran this through hindent --johan-tibell, looks
legit. Looks like you wrote it =)
This commit is contained in:
Chris Done 2014-12-31 19:33:59 +01:00
parent 7819eea565
commit c42b61bd4c

View File

@ -1,3 +1,5 @@
{-# LANGUAGE TupleSections #-}
module Main where module Main where
import Control.Monad import Control.Monad
@ -9,38 +11,54 @@ import Stackage.CompleteBuild
main :: IO () main :: IO ()
main = main =
join (execParser join $
(info (helpOption <*> versionOption <*> config) execParser $
info
(helpOption <*> versionOption <*> config)
(header "Stackage" <> (header "Stackage" <>
fullDesc))) fullDesc)
where helpOption = where
abortOption helpOption =
ShowHelpText abortOption ShowHelpText $
(long "help" <> long "help" <>
help "Show this help text") help "Show this help text"
versionOption = versionOption =
infoOption infoOption
("fpbuild version " ++ showVersion version) ("fpbuild version " ++ showVersion version)
(long "version" <> (long "version" <>
help "Show fpbuild version") help "Show fpbuild version")
config = config =
subparser (mconcat [cmnd completeBuild subparser $
(pure Nightly) mconcat
[ cmnd
(uncurry completeBuild)
(fmap (Nightly, ) buildFlags)
"nightly" "nightly"
"Build, test and upload the Nightly snapshot" "Build, test and upload the Nightly snapshot"
,cmnd completeBuild , cmnd
(pure (LTS Major)) (uncurry completeBuild)
(fmap (LTS Major, ) buildFlags)
"lts-major" "lts-major"
"Build, test and upload the LTS (major) snapshot" "Build, test and upload the LTS (major) snapshot"
,cmnd completeBuild , cmnd
(pure (LTS Minor)) (uncurry completeBuild)
(fmap (LTS Minor, ) buildFlags)
"lts-minor" "lts-minor"
"Build, test and upload the LTS (minor) snapshot" "Build, test and upload the LTS (minor) snapshot"
,cmnd (const justCheck) , cmnd
(const justCheck)
(pure ()) (pure ())
"check" "check"
"Just check that the build plan is ok"]) "Just check that the build plan is ok"]
cmnd exec parse name desc = cmnd exec parse name desc =
(command name command name $
(info (fmap exec parse) info
(progDesc desc))) (fmap exec parse)
(progDesc desc)
buildFlags =
BuildFlags <$>
fmap
not
(switch
(long "skip-tests" <>
help "Skip build and running the test suites"))