1{-# LANGUAGE RecordWildCards #-}
3import Stackage.Build (build, defaultBuildSettings)
4import Stackage.Init (stackageInit)
5import System.Environment (getArgs, getProgName)
6import Data.Set (fromList)
7import System.IO (hFlush, stdout)
9data BuildArgs = BuildArgs
11 , excluded :: [String]
15parseBuildArgs :: [String] -> IO BuildArgs
17 loop $ BuildArgs False [] False
20 loop x ("--no-clean":rest) = loop x { noClean = True } rest
21 loop x ("--exclude":y:rest) = loop x { excluded = y : excluded x } rest
22 loop x ("--no-platform":rest) = loop x { noPlatform = True } rest
23 loop _ (y:_) = error $ "Did not understand argument: " ++ y
30 BuildArgs {..} <- parseBuildArgs rest
31 build defaultBuildSettings
32 { cleanBeforeBuild = not noClean
33 , excludedPackages = fromList $ map PackageName excluded
34 , requireHaskellPlatform = not noPlatform
37 putStrLn "Note: init isn't really ready for prime time use."
38 putStrLn "Using it may make it impossible to build stackage."
39 putStr "Are you sure you want continue (y/n)? "
43 c:_ | c `elem` "yY" -> stackageInit
44 _ -> putStrLn "Probably a good decision, exiting."
45 ["update"] -> stackageInit >> error "FIXME update"
48 putStrLn $ "Usage: " ++ pn ++ " <command>"
49 putStrLn "Available commands:"
50 putStrLn " update Download updated Stackage databases. Automatically calls init."
51 putStrLn " init Initialize your cabal file to use Stackage"
52 putStrLn " build [--no-clean] [--no-platform] [--exclude package...]"
53 putStrLn " Build the package databases (maintainers only)"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list