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 $
(header "Stackage" <> info
fullDesc))) (helpOption <*> versionOption <*> config)
where helpOption = (header "Stackage" <>
abortOption fullDesc)
ShowHelpText where
(long "help" <> helpOption =
help "Show this help text") abortOption ShowHelpText $
versionOption = long "help" <>
infoOption help "Show this help text"
versionOption =
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
"nightly" [ cmnd
"Build, test and upload the Nightly snapshot" (uncurry completeBuild)
,cmnd completeBuild (fmap (Nightly, ) buildFlags)
(pure (LTS Major)) "nightly"
"lts-major" "Build, test and upload the Nightly snapshot"
"Build, test and upload the LTS (major) snapshot" , cmnd
,cmnd completeBuild (uncurry completeBuild)
(pure (LTS Minor)) (fmap (LTS Major, ) buildFlags)
"lts-minor" "lts-major"
"Build, test and upload the LTS (minor) snapshot" "Build, test and upload the LTS (major) snapshot"
,cmnd (const justCheck) , cmnd
(pure ()) (uncurry completeBuild)
"check" (fmap (LTS Minor, ) buildFlags)
"Just check that the build plan is ok"]) "lts-minor"
cmnd exec parse name desc = "Build, test and upload the LTS (minor) snapshot"
(command name , cmnd
(info (fmap exec parse) (const justCheck)
(progDesc desc))) (pure ())
"check"
"Just check that the build plan is ok"]
cmnd exec parse name desc =
command name $
info
(fmap exec parse)
(progDesc desc)
buildFlags =
BuildFlags <$>
fmap
not
(switch
(long "skip-tests" <>
help "Skip build and running the test suites"))