From c42b61bd4c1fd3fe88bb5355c7ce4ffdb7ecbbdc Mon Sep 17 00:00:00 2001 From: Chris Done Date: Wed, 31 Dec 2014 19:33:59 +0100 Subject: [PATCH] Reformat stackage.hs in tibbe style @snoyberg Not bad, ran this through hindent --johan-tibell, looks legit. Looks like you wrote it =) --- app/stackage.hs | 82 ++++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/app/stackage.hs b/app/stackage.hs index c324221e..386c5644 100644 --- a/app/stackage.hs +++ b/app/stackage.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE TupleSections #-} + module Main where import Control.Monad @@ -9,38 +11,54 @@ import Stackage.CompleteBuild main :: IO () main = - join (execParser - (info (helpOption <*> versionOption <*> config) - (header "Stackage" <> - fullDesc))) - where helpOption = - abortOption - ShowHelpText - (long "help" <> - help "Show this help text") - versionOption = - infoOption + join $ + execParser $ + info + (helpOption <*> versionOption <*> config) + (header "Stackage" <> + fullDesc) + where + helpOption = + abortOption ShowHelpText $ + long "help" <> + help "Show this help text" + versionOption = + infoOption ("fpbuild version " ++ showVersion version) (long "version" <> help "Show fpbuild version") - config = - subparser (mconcat [cmnd completeBuild - (pure Nightly) - "nightly" - "Build, test and upload the Nightly snapshot" - ,cmnd completeBuild - (pure (LTS Major)) - "lts-major" - "Build, test and upload the LTS (major) snapshot" - ,cmnd completeBuild - (pure (LTS Minor)) - "lts-minor" - "Build, test and upload the LTS (minor) snapshot" - ,cmnd (const justCheck) - (pure ()) - "check" - "Just check that the build plan is ok"]) - cmnd exec parse name desc = - (command name - (info (fmap exec parse) - (progDesc desc))) + config = + subparser $ + mconcat + [ cmnd + (uncurry completeBuild) + (fmap (Nightly, ) buildFlags) + "nightly" + "Build, test and upload the Nightly snapshot" + , cmnd + (uncurry completeBuild) + (fmap (LTS Major, ) buildFlags) + "lts-major" + "Build, test and upload the LTS (major) snapshot" + , cmnd + (uncurry completeBuild) + (fmap (LTS Minor, ) buildFlags) + "lts-minor" + "Build, test and upload the LTS (minor) snapshot" + , cmnd + (const justCheck) + (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"))