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
12 , excluded :: [String]
14 , onlyPermissive :: Bool
18parseBuildArgs :: [String] -> IO BuildArgs
24 , onlyPermissive = False
29 loop x ("--no-clean":rest) = loop x { noClean = True } rest
30 loop x ("--exclude":y:rest) = loop x { excluded = y : excluded x } rest
31 loop x ("--no-platform":rest) = loop x { noPlatform = True } rest
32 loop x ("--only-permissive":rest) = loop x { onlyPermissive = True } rest
33 loop x ("--allow":y:rest) = loop x { allowed = y : allowed x } rest
34 loop _ (y:_) = error $ "Did not understand argument: " ++ y
41 BuildArgs {..} <- parseBuildArgs rest
42 build defaultBuildSettings
43 { cleanBeforeBuild = not noClean
44 , excludedPackages = fromList $ map PackageName excluded
45 , requireHaskellPlatform = not noPlatform
48 then allowPermissive allowed
52 putStrLn "Note: init isn't really ready for prime time use."
53 putStrLn "Using it may make it impossible to build stackage."
54 putStr "Are you sure you want continue (y/n)? "
58 c:_ | c `elem` "yY" -> stackageInit
59 _ -> putStrLn "Probably a good decision, exiting."
60 ["update"] -> stackageInit >> error "FIXME update"
63 putStrLn $ "Usage: " ++ pn ++ " <command>"
64 putStrLn "Available commands:"
65 putStrLn " update Download updated Stackage databases. Automatically calls init."
66 putStrLn " init Initialize your cabal file to use Stackage"
67 putStrLn " build [--no-clean] [--no-platform] [--exclude package...] [--only-permissive] [--allow package]"
68 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