@@ -1,3 +1,5 @@
1+{-# LANGUAGE TupleSections #-}
1module Main where
3module Main where
3import Control.Monad
5import Control.Monad
@@ -9,38 +11,54 @@ import Stackage.CompleteBuild
10main :: IO ()
12main :: IO ()
12− join (execParser
15+ execParser $
13− (info (helpOption <*> versionOption <*> config)
17+ (helpOption <*> versionOption <*> config)
14− (header "Stackage" <>
18+ (header "Stackage" <>
15− fullDesc)))
19+ fullDesc)
16− where helpOption =
21+ helpOption =
18− ShowHelpText
22+ abortOption ShowHelpText $
19− (long "help" <>
23+ long "help" <>
20− help "Show this help text")
24+ help "Show this help text"
21− versionOption =
25+ versionOption =
22− infoOption
26+ infoOption
23 ("fpbuild version " ++ showVersion version)
27 ("fpbuild version " ++ showVersion version)
24 (long "version" <>
28 (long "version" <>
25 help "Show fpbuild version")
29 help "Show fpbuild version")
27− subparser (mconcat [cmnd completeBuild
34+ (uncurry completeBuild)
28− (pure Nightly)
35+ (fmap (Nightly, ) buildFlags)
29− "nightly"
36+ "nightly"
30− "Build, test and upload the Nightly snapshot"
37+ "Build, test and upload the Nightly snapshot"
31− ,cmnd completeBuild
39+ (uncurry completeBuild)
32− (pure (LTS Major))
40+ (fmap (LTS Major, ) buildFlags)
33− "lts-major"
41+ "lts-major"
34− "Build, test and upload the LTS (major) snapshot"
42+ "Build, test and upload the LTS (major) snapshot"
35− ,cmnd completeBuild
44+ (uncurry completeBuild)
36− (pure (LTS Minor))
45+ (fmap (LTS Minor, ) buildFlags)
37− "lts-minor"
46+ "lts-minor"
38− "Build, test and upload the LTS (minor) snapshot"
47+ "Build, test and upload the LTS (minor) snapshot"
39− ,cmnd (const justCheck)
49+ (const justCheck)
40− (pure ())
50+ (pure ())
42− "Just check that the build plan is ok"])
52+ "Just check that the build plan is ok"]
43− cmnd exec parse name desc =
53+ cmnd exec parse name desc =
44− (command name
54+ command name $
45− (info (fmap exec parse)
56+ (fmap exec parse)
46− (progDesc desc)))
57+ (progDesc desc)
63+ (long "skip-tests" <>
64+ help "Skip build and running the test suites"))