1{-# LANGUAGE RecordWildCards #-}
3import Stackage.Build (build, defaultBuildSettings)
4import Stackage.Init (stackageInit)
5import Stackage.Util (allowPermissive)
6import System.Environment (getArgs, getProgName)
7import Data.Set (fromList)
8import System.IO (hFlush, stdout)
10data BuildArgs = BuildArgs
11 { excluded :: [String]
13 , onlyPermissive :: Bool
17parseBuildArgs :: [String] -> IO BuildArgs
22 , onlyPermissive = False
27 loop x ("--exclude":y:rest) = loop x { excluded = y : excluded x } rest
28 loop x ("--no-platform":rest) = loop x { noPlatform = True } rest
29 loop x ("--only-permissive":rest) = loop x { onlyPermissive = True } rest
30 loop x ("--allow":y:rest) = loop x { allowed = y : allowed x } rest
31 loop _ (y:_) = error $ "Did not understand argument: " ++ y
38 BuildArgs {..} <- parseBuildArgs rest
39 build defaultBuildSettings
40 { excludedPackages = fromList $ map PackageName excluded
41 , requireHaskellPlatform = not noPlatform
44 then allowPermissive allowed
48 putStrLn "Note: init isn't really ready for prime time use."
49 putStrLn "Using it may make it impossible to build stackage."
50 putStr "Are you sure you want continue (y/n)? "
54 c:_ | c `elem` "yY" -> stackageInit
55 _ -> putStrLn "Probably a good decision, exiting."
56 ["update"] -> stackageInit >> error "FIXME update"
59 putStrLn $ "Usage: " ++ pn ++ " <command>"
60 putStrLn "Available commands:"
61 putStrLn " update Download updated Stackage databases. Automatically calls init."
62 putStrLn " init Initialize your cabal file to use Stackage"
63 putStrLn " build [--no-clean] [--no-platform] [--exclude package...] [--only-permissive] [--allow package]"
64 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